Php Prestashop:注意eval()和#x27;d代码[8]数组到字符串的转换
我一直在搜索这个网站和其他网站,无法解决每次打开后台产品页面时收到的通知Php Prestashop:注意eval()和#x27;d代码[8]数组到字符串的转换,php,arrays,string,type-conversion,prestashop,Php,Arrays,String,Type Conversion,Prestashop,我一直在搜索这个网站和其他网站,无法解决每次打开后台产品页面时收到的通知 Notice on line 279 in file /home/librer16/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code [8] Array to string conversion 一段代码: ... else { //var_dump('rend
Notice on line 279 in file /home/librer16/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code
[8] Array to string conversion
一段代码:
...
else {
//var_dump('renderTemplate', $_template->has_nocache_code, $_template->template_resource, $_template->properties['nocache_hash'], $_template->parent->properties['nocache_hash'], $_output);
//Line 279
if (!empty($_template->properties['nocache_hash']) && !empty($_template->parent->properties['nocache_hash'])) {
// replace nocache_hash
$_output = str_replace("{$_template->properties['nocache_hash']}", $_template->parent->properties['nocache_hash'], $_output);
$_template->parent->has_nocache_code = $_template->parent->has_nocache_code || $_template->has_nocache_code;
}
}
...
这个网站可以运行,但是这个通知很烦人
是否有删除通知的建议?尝试将该行替换为以下行:
if (is_array($_template->properties) && !empty($_template->properties['nocache_hash']) && is_array($_template->parent->properties) && !empty($_template->parent->properties['nocache_hash']))
无论如何,如果您停用调试模式,警告将不再显示
祝你好运。嗨,你的代码行在我这边运行。请你再解释一下,或者你检查了“$\u模板”对象的数据了吗?嗨,我不知道如何检查“$\u模板”中存储的数据。我使用print_r($_template->get_template_vars())进行了尝试;但是发生了一个致命的错误。对不起,它不起作用。是的,我可以停用调试模式,但我想消除网站上的错误和警告。干杯