Default product image not displayed

  • Posts: 193
  • Thank you received: 76
9 years 10 months ago #185388

-- 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:

 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
$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: 9 years 10 months ago by korzo.
The following user(s) said Thank You: ChristiaanR

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

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #185422

Hi,

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

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

  • Posts: 7
  • Thank you received: 1
9 years 10 months ago #187048

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.

  • Posts: 193
  • Thank you received: 76
9 years 10 months ago #187052

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

$img = $this->_getImage($fullFilename, $extension);
to
$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.

  • Posts: 7
  • Thank you received: 1
9 years 10 months ago #187053

Thanks, I will try it tonight
Olivier

Edit :
TESTED => OK
Thank you for your rapidity.
Olivier

Last edit: 9 years 10 months ago by Olivier2093.

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

Time to create page: 0.079 seconds
Powered by Kunena Forum