Post by szewern97 » Thu Sep 28, 2017 11:38 am

Hello there, I wasn't able to access to my site. When I go to my site I get an HTTP Error 500.
So I checked the error log and the hosting provider sent me this PHP log:

[28-Sep-2017 01:22:00 UTC] PHP Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'Unknown "str_replace" function in "__string_template__93b379fc6cfd9119fb201c82c717cfe86213ebb5662052075dc9fb5cf451a1fd" at line 16.' in /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php:574
Stack trace:
#0 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(351): Twig_ExpressionParser->getFunctionNodeClass('str_replace', 16)
#1 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(144): Twig_ExpressionParser->getFunctionNode('str_replace', 16)
#2 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(84): Twig_ExpressionParser->parsePrimaryExpression()
#3 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(41): Twig_ExpressionParser->getPrimary()
#4 /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php(91): Twig_ExpressionParser->parseExpression()
#5 /home/gloo/public_html/newgloo/system/lib in /home/gloo/public_html/newgloo/system/library/template/Twig/ExpressionParser.php on line 574

Has anyone encountered this problem or is there any way on how to fix this? Thank you in advance! :D

Newbie

Posts

Joined
Thu Sep 28, 2017 10:18 am

Post by straightlight » Thu Sep 28, 2017 11:06 pm

Are you using a fresh or upgrade version of Opencart v3.x and which version of Opencart are you using?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by gautam.hsquare » Mon Oct 16, 2017 5:47 pm

Hello szewern97,

I have to same problem is occurs so please advice me how to solved this problem.


Posts

Joined
Mon Oct 16, 2017 5:40 pm

Post by szewern97 » Thu Oct 26, 2017 1:41 pm

gautam.hsquare wrote:
Mon Oct 16, 2017 5:47 pm
Hello szewern97,

I have to same problem is occurs so please advice me how to solved this problem.
Hello, there so sorry for the late reply.. For my case, it seems like there is smth added in the theme table in my database, so after I've deleted it, the server is up again.. However, I'm not really sure if that is the cause, better to backup ur files before u delete it.. HAHA hope it helps

Newbie

Posts

Joined
Thu Sep 28, 2017 10:18 am

Post by bhadleumakant » Sun Sep 08, 2019 8:31 pm

Hi,
I am getting the same error.
When I open frontend. I can view it normally. Perpetualmart.com
But when I try to open the admin panel
perpetualmart.com/admin after entering credentials, I am getting below stact trace

Fatal error: Uncaught Twig_Error_Syntax: Unknown "isset" function in "common/dashboard.twig" at line 17. in system/library/template/Twig/ExpressionParser.php:574 Stack trace: #0
system/library/template/Twig/ExpressionParser.php(351): Twig_ExpressionParser->getFunctionNodeClass('isset', 17) #1 system/library/template/Twig/ExpressionParser.php(144): Twig_ExpressionParser->getFunctionNode('isset', 17) #2 system/library/template/Twig/ExpressionParser.php(84): Twig_ExpressionParser->parsePrimaryExpression() #3 system/library/template/Twig/ExpressionParser.php(41): Twig_ExpressionParser->getPrimary() #4
system/library/template/Twig/TokenParser/If.php(31): Twig_ExpressionParser->parseExpression() #5
system/library/template/Twig/Parser.php(187): Twig_TokenParser_If->parse(Object(Twig_Token)) #6
system/library/template in system/library/template/Twig/ExpressionParser.php on line 574





I check the Theme table as suggested in one of comments. But There is no any entry in my theme table

Newbie

Posts

Joined
Fri Oct 20, 2017 1:36 am

Post by OSWorX » Sun Sep 08, 2019 9:30 pm

First of all (!): which OpenCart version are you using?
Second: there is no "isset" in this template.
Because (third) isset does not exist in the twig syntax.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by letxobnav » Mon Sep 09, 2019 9:33 am

in short stop renaming .tpl files into .twig files and/or stop putting php in twig files.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by Egildo » Fri Dec 03, 2021 3:13 pm

When editing the twig file within the editor, the change is saved in the DB. I deleted the change in the Theme table and everything was resolved. It didn't seem like a twig or tpl problem, much less a php problem

Newbie

Posts

Joined
Fri Dec 03, 2021 3:09 pm
Who is online

Users browsing this forum: ravikumar22, Semrush [Bot] and 81 guests