Skip to main content

Default product image not displayed

More
11 years 8 months ago - 11 years 8 months ago #185388 by korzo
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6

When product has no image, default image is not displayed in any view(administration, category listing, product detail).
Also there are notices:
Code:
Notice: Trying to get property of non-object in components\com_hikashop\views\product\tmpl\listing_img_title.php on line 24 Notice: Trying to get property of non-object in components\com_hikashop\views\product\tmpl\show_block_img.php on line 64 Notice: Trying to get property of non-object in administrator\components\com_hikashop\views\product\tmpl\listing.php on line 182

Problem is in method hikashopImageHelper::getThumbnail(). In Hikashop 2.3.5 assignment
Code:
$extension = strtolower(substr($filename, strrpos($filename, '.') + 1));

were moved from line 437 to the start of method. As $filename is in this case null(product has no image), $extension will be also null and call to method $this->_getImage() will return null instead of object.

Solution is to move assignment in question after line 374.

When you will try to reproduce this bug, don't forget to delete cached thumbnails.
Last edit: 11 years 8 months ago by korzo.
The following user(s) said Thank You: ChristiaanR

Please Log in or Create an account to join the conversation.

More
11 years 8 months ago #185422 by Xavier
Hi,

Thanks for you report, I just corrected that issue on our end.

Please Log in or Create an account to join the conversation.

More
11 years 8 months ago #187048 by Olivier2093
Hello,
I encountered this problem and would be please to resolve it before the official correction
Could you please explain me in which file I have to :
"move assignment in question after line 374."
Thanks
Olivier

Please Log in or Create an account to join the conversation.

More
11 years 8 months ago #187052 by korzo
You are right. It was not fixed yet in installation package.

In the file administrator\components\com_hikashop\helpers\image.php
change line 505 from
Code:
$img = $this->_getImage($fullFilename, $extension);
to
Code:
$extension = strtolower(substr($filename, strrpos($filename, '.') + 1)); $img = $this->_getImage($fullFilename, $extension);
The following user(s) said Thank You: Olivier2093

Please Log in or Create an account to join the conversation.

More
11 years 8 months ago - 11 years 8 months ago #187053 by Olivier2093
Thanks, I will try it tonight
Olivier

Edit :
TESTED => OK
Thank you for your rapidity.
Olivier
Last edit: 11 years 8 months ago by Olivier2093.

Please Log in or Create an account to join the conversation.

Time to create page: 0.185 seconds
Powered by Kunena Forum