Jump to content

Migration 1.6 to 1.7 issue. Blank page not displayed due to a PHP error: Uncaught TypeError: Argument 1 passed to smartyClassnames()


Nes

Recommended Posts

Hi there,

Just upgraded my Prestashop 1.6.0.5 to 1.7.8.7 by using "1-Click Upgrade" module. After the migration process, a few minor adjustments were needed to access to the new back office. Now the backoffice is working properly without showing any error.

However, when I acces to the front end, I only can see a blank page. Checking the "error_log" file, I can see the following PHP error:

 PHP Fatal error:  Uncaught TypeError: Argument 1 passed to smartyClassnames() must be of the type array, null given, called in /home/szy3xy3c/devel.elrincondelcalzado.com/classes/Smarty/SmartyLazyRegister.php on line 95 and defined in /home/szy3xy3c/devel.elrincondelcalzado.com/config/smarty.config.inc.php:187
Stack trace:
#0 /home/szy3xy3c/devel.elrincondelcalzado.com/classes/Smarty/SmartyLazyRegister.php(95): smartyClassnames(NULL)
#1 /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/2b/35/5b/2b355b45d057651fda914754491803f0b22b9da4_2.file.layout-both-columns.tpl.php(51): SmartyLazyRegister->__call('smartyClassname...', Array)
#2 /home/szy3xy3c/devel.elrincondelcalzado.com/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_6375f5494c0e86_44973658(Object(Smarty_Internal_Template))
#3 /home/szy3xy3c/devel.elrincondelcalzado.com/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getR in /home/szy3xy3c/devel.elrincondelcalzado.com/config/smarty.config.inc.php on line 187

It looks like most of the contextual vars are undefined. The PHP error log also shows lots of "Notices" warning about this issue.

PHP Notice:  Undefined index: page in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 109
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Trying to get property 'value' of non-object in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 109
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Trying to access array offset on value of type null in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 109
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Trying to access array offset on value of type null in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 109
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Undefined index: page in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 129
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Trying to get property 'value' of non-object in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 129
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Trying to access array offset on value of type null in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 129
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Trying to access array offset on value of type null in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 129

 I am using PHP 7.4 with all the needed extensions and parameters.

  Any idea of how to solve this problem? It looks like there is some kind of incompatibility, deprecated code and methods or settings that I need to adjust and, hopefully, everything will work... but not sure where to look at and how to fix it. Any help will be appreciated. 

Thank you!

Link to comment
Share on other sites

Dnia 17.11.2022 o 10:42 AM, Nes napisał:

Hi there,

Just upgraded my Prestashop 1.6.0.5 to 1.7.8.7 by using "1-Click Upgrade" module. After the migration process, a few minor adjustments were needed to access to the new back office. Now the backoffice is working properly without showing any error.

However, when I acces to the front end, I only can see a blank page. Checking the "error_log" file, I can see the following PHP error:

 PHP Fatal error:  Uncaught TypeError: Argument 1 passed to smartyClassnames() must be of the type array, null given, called in /home/szy3xy3c/devel.elrincondelcalzado.com/classes/Smarty/SmartyLazyRegister.php on line 95 and defined in /home/szy3xy3c/devel.elrincondelcalzado.com/config/smarty.config.inc.php:187
Stack trace:
#0 /home/szy3xy3c/devel.elrincondelcalzado.com/classes/Smarty/SmartyLazyRegister.php(95): smartyClassnames(NULL)
#1 /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/2b/35/5b/2b355b45d057651fda914754491803f0b22b9da4_2.file.layout-both-columns.tpl.php(51): SmartyLazyRegister->__call('smartyClassname...', Array)
#2 /home/szy3xy3c/devel.elrincondelcalzado.com/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_6375f5494c0e86_44973658(Object(Smarty_Internal_Template))
#3 /home/szy3xy3c/devel.elrincondelcalzado.com/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getR in /home/szy3xy3c/devel.elrincondelcalzado.com/config/smarty.config.inc.php on line 187

It looks like most of the contextual vars are undefined. The PHP error log also shows lots of "Notices" warning about this issue.

PHP Notice:  Undefined index: page in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 109
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Trying to get property 'value' of non-object in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 109
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Trying to access array offset on value of type null in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 109
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Trying to access array offset on value of type null in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 109
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Undefined index: page in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 129
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Trying to get property 'value' of non-object in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 129
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Trying to access array offset on value of type null in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 129
[17-Nov-2022 10:28:32 Europe/Madrid] PHP Notice:  Trying to access array offset on value of type null in /home/szy3xy3c/devel.elrincondelcalzado.com/var/cache/prod/smarty/compile/classiclayouts_layout_full_width_tpl/7c/c9/0d/7cc90d142647e321512f986fe628903a46076f3b_2.file.head.tpl.php on line 129

 I am using PHP 7.4 with all the needed extensions and parameters.

  Any idea of how to solve this problem? It looks like there is some kind of incompatibility, deprecated code and methods or settings that I need to adjust and, hopefully, everything will work... but not sure where to look at and how to fix it. Any help will be appreciated. 

Thank you!

Yes. Clear the cache in Var folder for the start.

Link to comment
Share on other sites

Hi there,

Thanks for your replies. Unfortunately, deleting cache didn't work for me.. What it worked it was:

1- Creating a fresh installation of PS 1.7 in a new subdomain
2- Upgrade my PS 1.6 by "1-click upgrade" 
3- Swap databases. Fresh PS 1.7 database is using the updated database from my upgrades 1.6>1.7 version
4- Copy all my images in the fresh PS 1.7 installation
5- Normalize domines and delete old upgraded version and new fresh database

I am fixing some minor adjustments (modules..) but it looks good for now. 

I will post any important finding or highlight if any.

Cheers! 

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...