Prestashop php downgrade 8.2 to 8.1 fail

Hey all,

I need to the php version my Prestashop install uses.

I would be grateful for any tips about where my setup and attempts (see below) might be going wrong. :crossed_fingers::purple_heart:

My YunoHost server

Hardware: Old computer - Mac Mini circa 2014
YunoHost version: 11.1.19 (running on VM via VirtualBox)
I have access to my server :

  • Through SSH
  • through the webadmin
  • direct access via keyboard / screen

Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

What you are trying to achieve
Downgrade the php version prestashop uses from 8.2 to 8.1.

The context

My prestashop is throwing lots of errors (see below), that are a known issue of running

The Yunohost Prestashop app combines Prestashop 8.1.1 with php 8.2. But Prestashop is currently only compatible with php 8.1 or lower. See here: System requirements for PrestaShop 8 :: PrestaShop Developer Documentation

I have raised an issue with the Yunohost Prestashop packagers requesting the downgrade here: Issues · YunoHost-Apps/prestashop_ynh · GitHub

But in the meantime, I need to downgrade the php.

  • What I tried

Attempt 1:

Why: This was the only post I found on Prestashop forums or YH forums offering a strategy for downgrading php version.

Result 1: I get an error half way through, when I try to extract the tar folder.

Attempt 2:

Why: Based on these posts

Result 2: None of the different tar extraction strategies worked.

Returned error messages

Error message in console

PHP errors shown in debug mode

Unknown error on line 2578 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$actions is deprecated

Unknown error on line 2579 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$simple_header is deprecated

Unknown error on line 2580 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$bulk_actions is deprecated

Unknown error on line 2589 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$orderBy is deprecated

Unknown error on line 2590 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$orderWay is deprecated

Unknown error on line 2591 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$listTotal is deprecated

Unknown error on line 2595 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$shopLinkType is deprecated

Unknown error on line 2599 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$languages is deprecated

Unknown error on line 2600 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$specificConfirmDelete is deprecated

Unknown error on line 2601 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$imageType is deprecated

Unknown error on line 2602 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$no_link is deprecated

Unknown error on line 2603 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$colorOnBackground is deprecated

Unknown error on line 2604 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$ajax_params is deprecated

Unknown error on line 2606 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$default_form_language is deprecated

Unknown error on line 2613 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$row_hover is deprecated

Unknown error on line 2614 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$position_identifier is deprecated

Unknown error on line 2620 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$list_id is deprecated

Unknown error on line 2624 in file /var/www/prestashop/classes/controller/AdminController.php
[8192] Creation of dynamic property HelperView::$list_skip_actions is deprecated

Questions

Please let me know if you know another way to get around this one block in my php downgrade. Or if you know the YH app packagers for Prestashop, please nudge them for me. :slight_smile: Thank you for reading.

should be fixed in the testing branch

Hi @ericg

Thank you for updating the testing branch.

My php version has been downgraded. Success!

Unfortunately, the errors persist.

Here are the logs:

INFO08:16:15 php User Deprecated: Since api-platform/core 2.7: The service “ApiPlatform\Core\Bridge\Symfony\Routing\IriConverter” is deprecated, use ApiPlatform\Symfony\Routing\IriConverter instead. { “exception”: {} }
INFO08:16:15 request Matched route “admin_categories_index”. { “route”: “admin_categories_index”, “route_parameters”: { “_route”: “admin_categories_index”, “_controller”: “PrestaShopBundle\Controller\Admin\Sell\Catalog\CategoryController::indexAction”, “_legacy_controller”: “AdminCategories”, “_legacy_link”: “AdminCategories”, “_legacy_parameters”: { “id_category”: “categoryId” }, “categoryId”: null }, “request_uri”: “https://shop.nqo.link/admin624tllio5njwhgkwbtw/index.php/sell/catalog/categories?_token=uTMUDpOFR-QSWr1BE6z2NjySSaRd7QmCtMMBzndwKLk”, “method”: “GET” }
DEBUG08:16:15 doctrine SELECT t0.id_lang AS id_lang_1, t0.name AS name_2, t0.active AS active_3, t0.iso_code AS iso_code_4, t0.language_code AS language_code_5, t0.locale AS locale_6, t0.date_format_lite AS date_format_lite_7, t0.date_format_full AS date_format_full_8, t0.is_rtl AS is_rtl_9 FROM ps_lang t0 WHERE t0.id_lang = ? [ 1 ]
DEBUG08:16:15 security Read existing security token from the session. { “key”: “_security_main”, “token_class”: “Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken” }
DEBUG08:16:15 security User was reloaded from a user provider. { “provider”: “PrestaShopBundle\Security\Admin\EmployeeProvider”, “username”: “hello@neuroqueero.com” }
INFO08:16:15 php User Deprecated: __construct is deprecated since version 8.1 and will be removed in the next major version. { “exception”: {} }
INFO08:16:15 php User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0 { “exception”: {} }
DEBUG08:16:15 doctrine SELECT t0.id AS id_1, t0.employee AS employee_2, t0.shop AS shop_3, t0.controller AS controller_4, t0.action AS action_5, t0.filter AS filter_6, t0.filter_id AS filter_id_7 FROM ps_admin_filter t0 WHERE t0.employee = ? AND t0.shop = ? AND t0.filter_id = ? LIMIT 1 [ 1, 1, “category” ]
DEBUG08:16:15 doctrine SELECT t0.id AS id_1, t0.employee AS employee_2, t0.shop AS shop_3, t0.controller AS controller_4, t0.action AS action_5, t0.filter AS filter_6, t0.filter_id AS filter_id_7 FROM ps_admin_filter t0 WHERE t0.employee = ? AND t0.shop = ? AND t0.filter_id = ? LIMIT 1 [ 1, 1, “category” ]
INFO08:16:15 php User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0 { “exception”: {} }
INFO08:16:15 php User Deprecated: Not specifying the optional ShopConstraint parameter is deprecated since version 1.7.8.0 { “exception”: {} }
DEBUG08:16:15 doctrine SELECT COUNT(cp.id_product) AS products_count, c.id_category, c.id_parent, c.active, cl.name, cl.description, cs.position FROM ps_category c LEFT JOIN ps_category_lang cl ON c.id_category = cl.id_category AND cl.id_lang = :context_lang_id AND cl.id_shop = c.id_shop_default LEFT JOIN ps_category_shop cs ON c.id_category = cs.id_category AND cs.id_shop = :context_shop_id LEFT JOIN ps_category_product cp ON c.id_category = cp.id_category WHERE (c.id_category != :root_category_id) AND (c.id_parent = :id_category_parent) AND (c.id_category != :root_category_id) AND (c.id_category != :root_category_id) GROUP BY c.id_categoryORDER BY position asc LIMIT 50 { “context_lang_id”: 1, “context_shop_id”: 1, “root_category_id”: “1”, “id_category_parent”: 2 }
DEBUG08:16:15 doctrine SELECT COUNT(c.id_category) FROM ps_category c LEFT JOIN ps_category_lang cl ON c.id_category = cl.id_category AND cl.id_lang = :context_lang_id AND cl.id_shop = c.id_shop_default LEFT JOIN ps_category_shop cs ON c.id_category = cs.id_category AND cs.id_shop = :context_shop_id WHERE (c.id_category != :root_category_id) AND (c.id_parent = :id_category_parent) AND (c.id_category != :root_category_id) AND (c.id_category != :root_category_id) { “context_lang_id”: 1, “context_shop_id”: 1, “root_category_id”: “1”, “id_category_parent”: 2 }
INFO08:16:15 php User Deprecated: The “$name” argument in method “Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::__construct()” is deprecated since Symfony 4.2. { “exception”: {} }
INFO08:16:15 php User Deprecated: The “$version” argument in method “Symfony\Component\HttpKernel\DataCollector\ConfigDataCollector::__construct()” is deprecated since Symfony 4.2. { “exception”: {} }
INFO08:16:15 php User Deprecated: __construct is deprecated since version 8.1 and will be removed in the next major version. { “exception”: {} }
INFO08:16:15 php User Deprecated: The “Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent::getException()” method is deprecated since Symfony 4.4, use “getThrowable()” instead. { “exception”: {} }
INFO08:16:15 php User Deprecated: The “Symfony\Component\Debug\Exception\FatalThrowableError” class is deprecated since Symfony 4.4. { “exception”: {} }
INFO08:16:15 php User Deprecated: The “Symfony\Component\Debug\Exception\FatalErrorException” class is deprecated since Symfony 4.4, use “Symfony\Component\ErrorHandler\Error\FatalError” instead. { “exception”: {} }
CRITICAL08:16:15 request Uncaught PHP Exception TypeError: “stripslashes(): Argument #1 ($string) must be of type string, null given” at /var/www/prestashop/src/Core/Grid/Data/Factory/AbstractCategoryDataFactory.php line 77 { “exception”: {} }
CRITICAL08:16:15 php Uncaught Error: stripslashes(): Argument #1 ($string) must be of type string, null given { “exception”: {} }

Hi all,

I removed these errors by running the following queries in PHPMyAdmin:

UPDATE `ps_category_lang` SET `additional_description`='' WHERE `additional_description` IS NULL;
UPDATE `ps_category_lang` SET `description`='' WHERE `description` IS NULL;
UPDATE `ps_category_lang` SET `meta_description`='' WHERE `meta_description` IS NULL;
UPDATE `ps_category_lang` SET `meta_keywords`='' WHERE `meta_keywords` IS NULL;
UPDATE `ps_category_lang` SET `meta_title`='' WHERE `meta_title` IS NULL;

Thanks to @Hlavtox here: Category issue after bulk uploading categories using PHP 8.2. After downgrading to PHP 8.1, errors persist · Issue #34535 · PrestaShop/PrestaShop · GitHub

Sharing in case someone here has similar troubles with Prestashop on Yunohost.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.