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
inframes.com Website Design with Opencart, Wordpress, Lucee and bespoke application design and development
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster * Survey Plus
They ARE
inframes.com Website Design with Opencart, Wordpress, Lucee and bespoke application design and development
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster * Survey Plus
inframes.com Website Design with Opencart, Wordpress, Lucee and bespoke application design and development
$this->setAttribute('needs_environment', $function->needsEnvironment());
I don't know what that does, to be honest.
inframes.com Website Design with Opencart, Wordpress, Lucee and bespoke application design and development
You have a very different path in your system folder
appears something like the environment loader is not working for the function
I will struggle to help from here as I do not have the same files etc as you
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Rich Snippets * Google Tag Manager * Export/Import Tool * SpamBot Buster * Survey Plus
/system/library/template/Twig/Node/Expression
I assure you it is part of the Opencart distributable.
inframes.com Website Design with Opencart, Wordpress, Lucee and bespoke application design and development
I have
/htdocs/Shop/system/library/template
and inside just 2 files
template.php
twig.php
You have EXTENDED Twig
Either deliberately because you need that or NOT I don't know
I do know that is NOT the CORE STANDARD install.
Your function is failing because the environment is not loaded
Maybe see if you can find this code SOMEWHERE :-)
Code: Select all
$twig = new \Twig\Environment($loader);
$function = new \Twig\TwigFunction('function_name', function () {
// ...
});
$twig->addFunction($function);
However, it is not what is being delivered from Opencart.com which are the distributions that this site officially supports. It is confirmed that the TWIG sub-folder is not included in the system/library/template folder. Only two files are officially distributed. Which means, you are using a development version of Opencart which also leads to why you may encounter additional errors from those distributions.siteadvice wrote: ↑Fri Jan 15, 2021 1:52 am@mikeinterserv You do not have this folder...?
/system/library/template/Twig/Node/Expression
I assure you it is part of the Opencart distributable.
The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.
Regards,
Straightlight
Programmer / Opencart Tester
If on a version below 3.0.3.6 ensure you are on PHP 7.3.
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.
Regards,
Straightlight
Programmer / Opencart Tester
However to clear something up ... see attached the official download - because I do have that folder
Attachments
Screen-Shot-2021-01-14-at-19.23.31.png (195.27 KiB) Viewed 306 times
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos
But vm instances will NOT start on europe-west2 on google cloud
If I have that file structure there I can help you more.
You shouldn't be comparing 3.0.3.6 to 3.0.3.2.
https://github.com/opencart/opencart/tr ... y/template
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
Take a fresh copy of it on to dev and see if the issue still occurs.siteadvice wrote: ↑Thu Jan 14, 2021 11:46 pmMy 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.
For quick, professional OpenCart support please email info@antropy.co.uk
Users browsing this forum: noxtras and 14 guests