Skip to main content

Strange error on some products with characteristics

More
2 years 6 months ago #359851 by verzevoul
-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.4.3
-- PHP version -- : 8.1
-- Error-message(debug-mod must be tuned on) -- : Attempt to modify property "values" on null

Hello.
I m facing an error Attempt to modify property "values" on null
Code:
Call stack # Function Location 1 () JROOT/administrator/components/com_hikashop/classes/product.php:2187 2 hikashopProductClass->addCharacteristics() JROOT/components/com_hikashop/views/product/view.html.php:1674 3 ProductViewProduct->show() JROOT/components/com_hikashop/views/product/view.html.php:28 4 ProductViewProduct->display() JROOT/libraries/src/MVC/Controller/BaseController.php:660 5 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2577 6 hikashopController->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2290 7 hikashopController->show() JROOT/libraries/src/MVC/Controller/BaseController.php:693 8 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_hikashop/helpers/helper.php:2555 9 hikashopController->execute() JROOT/components/com_hikashop/hikashop.php:88 10 require_once() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:71 11 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:73 12 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:361 13 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:208 14 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:249 15 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:293 16 Joomla\CMS\Application\CMSApplication->execute() JROOT/includes/app.php:61 17 require_once() JROOT/index.php:32

on some products with characteristics
On J3 they are working fine, the issue is only on J4

This message contains confidential information

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

More
2 years 6 months ago #359855 by nicolas
Hi,

I think it's because the characteristics linked to the main product are (at least one) different from the characteristics linked to one or several variants of the product. This should normally not happen.
And because PHP 8.1 is stricter than previous versions, you get a fatal error instead of a warning which was hidden.
I suppose you must be using an older version of PHP on your J3 website.
Add the code:
Code:
if(!isset($element->characteristics[$characteristic->characteristic_parent_id])) { continue; }
before the line of the error (2187) in /administrator/components/com_hikashop/classes/product.php and it should avoid generating the error.
The following user(s) said Thank You: verzevoul

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

More
2 years 6 months ago #359892 by verzevoul
Sorry to spam this topic Nicola.
But I wonder if there is a way I discover what is causing the rerrects to http. When I add the rule to htaccess or/ and joomla backend (entrire site https) , I get error for too many redirections.
Like a plugin or something is causing it.
Do you have an idea why ?

Thank you!

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

More
2 years 6 months ago #359893 by nicolas
Hi,

Normally, that's made by a rule in the htaccess.
So that's where I would first look.

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

More
2 years 6 months ago #359895 by verzevoul
ok, I found it. It was hikashop no ssl plugin. It is the first time I see this plugin. I diasbled it and it is now ok.
Thanks

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

More
2 years 6 months ago #359896 by nicolas
Hi,

Ah yes. That's true HikaShop has this plugin to be able to remove the https outside the checkout.
That's something that was asked by some years ago.
Now, websites normally always use https, so it should normally not be used.

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

Time to create page: 0.167 seconds
Powered by Kunena Forum