[SOLVED] Twig error / blank product edit page
Posted: Thu Jan 14, 2021 11:46 pm
I have been trying to solve a problem with my development server and I'm completely stuck, so I hope someone in the community has some advice for me.
My live, public site works fine. However, when using my duplicate development site and trying to open a product edit page in the Opencart dashboard I get a blank white screen.
The error from the error_log file is pasted below (path names removed for privacy and to make it easier to read).
The development server is a very similar spec to the live server and both sites are using the same version of PHP. The version of Opencart is the same as the live site (3.0.3.2) and the development database is a recent backup from the live server.
I have tried restoring the whole system/library/template folder from the original Opencart 3.0.3.2 repository, just in case, but that didn't help. I didn't really think it would, but it was worth a try!
The obvious culprit would be one of the extensions, but I have tried disabling every extension that is not built in to Opencart and it doesn't make any difference.
Any ideas anybody!?
PHP Fatal error: Uncaught Error: Call to a member function needsEnvironment() on bool in /home/{{path}}/system/library/template/Twig/Node/Expression/Function.php:26
Stack trace:
#0 /home/{{path}}/system/library/template/Twig/Compiler.php(97): Twig_Node_Expression_Function->compile(Object(Twig_Compiler))
#1 /home/{{path}}/system/library/template/Twig/Node/Print.php(30): Twig_Compiler->subcompile(Object(Twig_Node_Expression_Function))
#2 /home/{{path}}/system/library/template/Twig/Node.php(110): Twig_Node_Print->compile(Object(Twig_Compiler))
#3 /home/{{path}}/system/library/template/Twig/Node.php(110): Twig_Node->compile(Object(Twig_Compiler))
#4 /home/{{path}}/system/library/template/Twig/Compiler.php(97): Twig_Node->compile(Object(Twig_Compiler))
#5 /home/{{path}}/system/library/template/Twig/Node/Module.php(277): Twig_Compiler->subcompile(Object(Twig_N in /home/{{path}}/system/library/template/Twig/Node/Expression/Function.php on line 26
My live, public site works fine. However, when using my duplicate development site and trying to open a product edit page in the Opencart dashboard I get a blank white screen.
The error from the error_log file is pasted below (path names removed for privacy and to make it easier to read).
The development server is a very similar spec to the live server and both sites are using the same version of PHP. The version of Opencart is the same as the live site (3.0.3.2) and the development database is a recent backup from the live server.
I have tried restoring the whole system/library/template folder from the original Opencart 3.0.3.2 repository, just in case, but that didn't help. I didn't really think it would, but it was worth a try!
The obvious culprit would be one of the extensions, but I have tried disabling every extension that is not built in to Opencart and it doesn't make any difference.
Any ideas anybody!?
PHP Fatal error: Uncaught Error: Call to a member function needsEnvironment() on bool in /home/{{path}}/system/library/template/Twig/Node/Expression/Function.php:26
Stack trace:
#0 /home/{{path}}/system/library/template/Twig/Compiler.php(97): Twig_Node_Expression_Function->compile(Object(Twig_Compiler))
#1 /home/{{path}}/system/library/template/Twig/Node/Print.php(30): Twig_Compiler->subcompile(Object(Twig_Node_Expression_Function))
#2 /home/{{path}}/system/library/template/Twig/Node.php(110): Twig_Node_Print->compile(Object(Twig_Compiler))
#3 /home/{{path}}/system/library/template/Twig/Node.php(110): Twig_Node->compile(Object(Twig_Compiler))
#4 /home/{{path}}/system/library/template/Twig/Compiler.php(97): Twig_Node->compile(Object(Twig_Compiler))
#5 /home/{{path}}/system/library/template/Twig/Node/Module.php(277): Twig_Compiler->subcompile(Object(Twig_N in /home/{{path}}/system/library/template/Twig/Node/Expression/Function.php on line 26