View Single Post
  #27  
Old 11-13-2008, 09:29 PM
 
benz benz is offline
 

Senior Member
  
Join Date: Oct 2007
Posts: 111
 

Default Re: free Dynamic Images module released

I've had this problem too - I believe it occurs on sites that do not have their store in the root directory, the problem seems to come from how the path for default_image is calculated, the default image path gets passed to the thumbnail function as something like /store/default_image.gif rather than "http://somedomain.com/store/default_image.gif", the file_exists() check then can't find the image and throws a smarty error around line 283.

I threw in a quick hack to suppress the error message if the thumbnail path started with a /. The rest remains unchanged, as skip_thumb is still set true it will jump through the rest of the code and just return the original thumbnail path, xcart then looks happy.

Having done this nastily I'd love to see the RIGHT way to fix it, as this felt really dirty
...and I'm sure it will bite me in the near future....

In function.thumb_imp.php around line 283 change:
PHP Code:
$smarty->trigger_error('thumb: image file "' $params['file'] . '" does not exist'); 
to
PHP Code:
# benz - nasty hack to suppress the error and skip thumb if its  default_image issue
if( !preg_match('/^\//',$params['file'])) $smarty->trigger_error('thumb: image file "' $params['file'] . '" does not exist');
#/benz 

PS the line break in the code snippet above happened right in the middle of the match part of the regular expression (which is kind of important!), it should read !preg_match('/^\//',.......
__________________
Version 4.1.8
Version 4.1.11
Reply With Quote