Undefined offset in image.php after upgrade

  • Posts: 4
  • Thank you received: 0
10 years 7 months ago #189823

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.23
-- Browser(s) name and version -- : Chrome v40 Firefox v35
-- Error-message(debug-mod must be tuned on) -- : Notice: Undefined offset: 0 in /var/www/.../httpdocs/administrator/components/com_hikashop/helpers/image.php on line 381 Notice: Undefined offset: 1 in /var/www/.../httpdocs/administrator/components/com_hikashop/helpers/image.php on line 381

I did a double upgrade today, from J2.5.28 to 3.3.8 and Hikashop 2.2.2 to 2.3.5.

The upgrades seemed to go well. I initially had a problem because Configuration | Images | Force images size was set to Yes yet there were no image widths. Setting Force Images size to No cured that.

When I access my online shop, my three category images display correctly as does the label beneath them but the above error message appears on top of the labels. I can continue and click on the categories to see the products they contain.

Can you help me to resolve these messages please?

In images, thumbnail is on and there are thumbnail dimensions. Produce page images has the same dimensions. Force images size = No. Scale mode = keep ratio. Image width and height have values.

Last edit: 10 years 7 months ago by djb.

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 7 months ago #189828

Hi,

I don't think the issue is link to the helper but to the function which call the getThumbnail function.
The "size" parameter which is passed to the function looks like to be wrong or uncompleted.

Do you have some view overrides ?
Where exactly the notice message are displayed (which which kind of view) ?

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 4
  • Thank you received: 0
10 years 7 months ago #189864

Jerome,

Thank you for your quick reply.

I only see the errors when I am in debug mode with maximum reporting turned on.

No, I don't use view overrides.

I attach a screenshot showing where the messages appear.

With thanks
David

Attachments:

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 7 months ago #189868

Hi,

Well ; I don't know what the parameter $size contain in your website but I think the best will be to update the Helper image to manage it.
By replacing in the file "administrator/components/com_hikashop/helpers/image.php" the code

if(empty($size))
	$size = array('x' => (int)$config->get('thumbnail_x', 100), 'y' => (int)$config->get('thumbnail_y', 100));
By
if(empty($size) || !is_array($size) || (!isset($size['x']) && !isset($size[0])))
	$size = array('x' => (int)$config->get('thumbnail_x', 100), 'y' => (int)$config->get('thumbnail_y', 100));
It should fix your issue.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.056 seconds
Powered by Kunena Forum