Modification to make PHP 7.2 compatible
olecorre opened this issue · 10 comments
PrestaShop - ChangeLog
1.6.1.25 (2019-08-26)
-
classes/AdminTab.php line 511 change "$function($value)"
-
classes/AdminTab.php line 530 change "$function($value)"
-
classes/AdminTab.php line 1675 change "create_function"
-
classes/Cart.php line 2772 add control "is_array"
-
classes/Cookie.php line 79 change "else" and add 2 constants OPENSSL_KEY and OPENSSL_IV
Mcrypt disappears. I had Warning issues with existing keys that are not good for Openssl. So I added two new constants with the correctly generated keys. -
classes/ImageType.php line 173 change "if"
-
classes/ObjectModel.php line 64 change "type of variable"
-
classes/Rijndael.php line 97 delete constant "MCRYPT_RIJNDAEL_128" it's not exists
-
classes/Tools.php line 2151 change "create_function"
-
classes/Tools.php line 3736 change "create_function"
-
classes/controller/AdminController.php line 549 change "paramaters" for function "initBreadcrumbs"
-
classes/controller/AdminController.php line 2329 change "if"
-
classes/controller/AdminController.php line 3467 change "$function($value)"
-
classes/controller/AdminController.php line 3469 change "$function($value)"
-
classes/helper/HelperList.php line 198 change "create_function"
-
classes/module/Module.php line 1554 change "create_function"
-
classes/stock/SupplyOrderDetail.php line 304 change "$function($value)"
-
controllers/admin/AdminAttributeGeneratorController.php line 79 change "create_function"
-
controllers/admin/AdminOrdersController.php line 589 change "$function"
-
controllers/admin/AdminProductsController.php line 2221 change "$function"
-
controllers/admin/AdminProductsController.php line 2224 change "$function"
-
controllers/admin/AdminProductsController.php line 2240 change "$function"
-
controllers/front/ProductController.php line 254 add controle "is_array"
-
install-dev/install_version.php line 27 change version
-
install-dev/fixtures/fashion/data/generate_attribute.php line 203 change "create_function"
-
install-dev/upgrade/upgrade.php line 258 add constants OPENSSL_KEY and OPENSSL_IV
-
install-dev/models/install.php line 93 add create constants OPENSSL_KEY and OPENSSL_IV
-
tools/profiling/Controller.php line 358 change "create_function"
-
tools/smarty/sysplugins/smarty_internet_compilebase.php rewrite function "getAttributes" for delete function "each"
the smarty update was too much change, so I decided to redo one of the functions so that it would be compatible. I had no mistakes after this correction -
tools/tcpdf update TCPDF to the the last version 6.2.26
-
admin-dev/themes/default/template/controllers/modules/js.tpl line 37 change "count" to "is_array"
-
admin-dev/themes/default/template/controllers/information/helpers/view/view.tpl
Here are my modifications to make PS 1.6 PHP 7.2 compatible, very busy with work, I was a little late sorry.
I have detailed my corrections in the issues and PR.
I tested it on two PHP 7.2 and PHP 7.3 environments and no errors were reported.
Feel free to give me a feedback
The use of this version will require support because of the modules that can be added and not compatible with the PHP version
Really really nice ... I wait with impatience this to be released
I don't see any changes on Cookie.php class despite it's indicated on changelog. Don't you?
That's right, I added it
Hello!
thanks for your contribution!
But do you have a new, more detailed update, including cookies.php?
I'm a little bitch! and for example in the phrase:
classes/Cart.php line 2772 add control "is_array"
I'm not sure how to make the change :(
Normaly is: 2772= } elseif (count($product_list)) {
So I have to write: 2772: } elseif (is_array($product_list)) {
Thanks for any reply!
Hello
if $product_list is empty, the count will cause an error, before the count we check that $product_list is an array.
} elseif (is_array($product_list) && count($product_list)) {
No errors detected in cookie.php on php7.2 and 7.3
Thanks for your quick answer.
Then I found the guide for changes
#4
For now everything is works fine with my prestashop 1.6.1.23 and PHP 7.2.29
Only 1 Warning according to debug:
Warning on line 104 en archivo ... /public_html/shop/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code
[2] count(): Parameter must be an array or an object that implements Countable
And I don't know why, but I've lost the option to change the carrier from "order" ???
Hi!
Thanks for your work with this update. I have tried it with PHP 7.2.24 / Ubuntu 18.04.6 and it seems to be working fine.