Jump to content

Prestashop 8.01 issues with PHP 8.0


Recommended Posts

Hi Everyone,

We upgraded our shop fine from PS 1.7.8.8 to PS 8.01.  Everything works great with PHP 7.4.  When we switch to PHP 8.0 or 8.1 we're seeing some issues.

The first issue we saw was that some uninstalled but not deleted older modules were causing PHP fatal errors with the backoffice found in the psadmin error log.  Once we deleted those old folders we were able to access the back office again.

The new issue we're seeing seems like a core PS issue.  When switching to PHP 8+ and trying to adjust the quantity on the product page we're getting this:

[07-Mar-2023 14:35:37 Canada/Atlantic] PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, PrestaShop\PrestaShop\Adapter\Presenter\Product\ProductLazyArray given in /home2/canadac3/public_html/controllers/front/ProductController.php:517 Stack trace: #0 /home2/canadac3/public_html/override/controllers/front/ProductController.php(247): ProductControllerCore->getMinimalProductOrDeclinationQuantity(Object(PrestaShop\PrestaShop\Adapter\Presenter\Product\ProductLazyArray)) #1 /home2/canadac3/public_html/classes/controller/Controller.php(334): ProductController->displayAjaxRefresh() #2 /home2/canadac3/public_html/classes/Dispatcher.php(510): ControllerCore->run() #3 /home2/canadac3/public_html/override/classes/Dispatcher.php(1541): DispatcherCore->dispatch() #4 /home2/canadac3/public_html/index.php(28): Dispatcher->dispatch() #5 {main}

 

Does anyone have any ideas about this one?  The issue disappears when we switch back to PHP 7.4.  

 

Link to comment
Share on other sites

  • 1 month later...

Hi, I´ve the same problem when I adjust quantity for the cart, adds the products to the cart but remains thinking, you have to refresh the browser for the page to return.

------------------------------------------------------------------------------------------------------------------------

[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "PHP message: PHP Warning:  Undefined array key 0 in /var/www/vhosts/mydomain.eu/httpdocs/override/classes/Link.php on line 118"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, PrestaShop\PrestaShop\Adapter\Presenter\Product\ProductLazyArray given in /var/www/vhosts/mydomain.eu/httpdocs/controllers/front/ProductController.php:517"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "Stack trace:"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "#0 /var/www/vhosts/mydomain.eu/httpdocs/override/controllers/front/ProductController.php(247): ProductControllerCore->getMinimalProductOrDeclinationQuantity()"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "#1 /var/www/vhosts/mydomain.eu/httpdocs/classes/controller/Controller.php(334): ProductController->displayAjaxRefresh()"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "#2 /var/www/vhosts/mydomain.eu/httpdocs/classes/Dispatcher.php(510): ControllerCore->run()"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "#3 /var/www/vhosts/mydomain.eu/httpdocs/index.php(28): DispatcherCore->dispatch()"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "#4 {main}"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "  thrown in /var/www/vhosts/mydomain.eu/httpdocs/controllers/front/ProductController.php on line 517"

------------------------------------------------------------------------------------------------------------------------------

This is my configuration:

PS 8.03

PHP  8.0.28

Template Wharehouse 4.6.1

 

there is a message that appears to me from "UNDEFINED"

935242001.jpg.4280c2e39d6676946004b1fc967d39db.jpg

 

I have disabled all non-native modules, I have even tried with the classic theme and it gives me the same error

Some help ??

Edited by pikasso72 (see edit history)
Link to comment
Share on other sites

I have found the problem and it is a bug of the Wharehouse theme, attached image.

935242001.jpg.aea2aff337ca5b11e4b982bdbd01a318.jpg

 

This option should be set to "NO" if you are not using attributes or combinations.

The problem is that if the product does not have attributes, after adding to the cart it is left wondering if the option "Combination loading" is activated in the Wharehouse configuration

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...