Post by ashon » Sat Oct 12, 2019 11:47 pm

Opencart 3.0.3.2

so this is a wired one and not sure if this will be fixed but not all the time but random when i go to error logs on admincp i get this at the top


Notice: Array to string conversion in /******/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 83Array

http://prntscr.com/pid7xl

and on line 83 is nothing so i screenshot like 50 lines to see if anyone can help - http://prntscr.com/pid8g1

Active Member

Posts

Joined
Sat Apr 18, 2015 2:18 am

Post by opencartmart » Sun Oct 13, 2019 2:21 pm

Does it show only on the log page or in any page randomly?

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by letxobnav » Sun Oct 13, 2019 4:35 pm

well, that is php doing an eval on a template at line 403.
The "notice" is probably on line 83 of the template content.
So you could dump the template content in environment.php with:

Code: Select all

error_log($content);
before:

Code: Select all

               eval('?>'.$content);
which would give you something like:

Code: Select all

[13-Oct-2019 08:25:20 UTC] <?php

/* common/header.twig */
class __TwigTemplate_b85b933bd2162f9f8c8f19f7905f1eb9a5ac5486bd51c87769c817b3e96d4727 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {

etc.
then you could see what it is complaining about if you have enough free time on your hands as it could even be that the content of the error log causes this and as such "sometimes" triggers this.

Just remember, this is just a notice, not an error, I would not waste my time with it.

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 ashon » Sun Oct 13, 2019 11:50 pm

opencartmart wrote:
Sun Oct 13, 2019 2:21 pm
Does it show only on the log page or in any page randomly?
its random might not see it for 1 week then i will see it when on error log but above it and when i refresh it will go and not come back and then random come back

https://prnt.sc/pid7xl

Active Member

Posts

Joined
Sat Apr 18, 2015 2:18 am

Post by opencartmart » Mon Oct 14, 2019 2:26 pm

ashon wrote:
Sun Oct 13, 2019 11:50 pm
its random might not see it for 1 week then i will see it when on error log but above it and when i refresh it will go and not come back and then random come back
As it displays in place of success message, it is expected behaviour that it will go away once you refresh browser and will not show again. Look like it will show again if you clear the log i.e after you click the Clear button. If this is the case, you have must have an ocmod (vqmod or whatever you use) that modified success message incorrectly (it must be a string but it's turned into array somehow). Do you have any module related with log? Try disable that

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by wackmofo » Sat Sep 05, 2020 1:24 pm

I have a similar issue, that appears also when using the default theme. The error log says this:

Code: Select all

2020-09-05 5:12:38 - PHP Notice:  Array to string conversion in /home/***/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 30
2020-09-05 5:12:38 - PHP Notice:  Array to string conversion in /home/***/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 30
2020-09-05 5:12:38 - PHP Notice:  Array to string conversion in /home/***/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 30
2020-09-05 5:12:38 - PHP Unknown:  Object of class Request could not be converted to string in /home/***/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 30
2020-09-05 5:12:38 - PHP Unknown:  Object of class Cart\Customer could not be converted to string in /home/***/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 30
2020-09-05 5:12:38 - PHP Unknown:  Object of class Cart\Cart could not be converted to string in /home/***/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 30
The problem is, I wanted to use an if statement in my template and when I listed all the keys on the frontend, these were the errors:

Code: Select all

document_links - Notice: Array to string conversion in /home/***/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 61Array
document_styles - Notice: Array to string conversion in /home/***/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 61Array
document_scripts - Notice: Array to string conversion in /home/***/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 61Array
route - Unknown: Object of class Request could not be converted to string in /home/***/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 61
customer - Unknown: Object of class Cart\Customer could not be converted to string in /home/***/public_html/system/library/template/Twig/Environment.php(403) : eval()'d code on line 61

New member

Posts

Joined
Sun Jun 17, 2012 11:35 pm
Who is online

Users browsing this forum: No registered users and 33 guests