我尝试为 prestashop 安装一页UIImageWriteToSavedPhotosAlbum(image, self, #selector(imageSaved(image:didFinishSavingWithError:contextInfo:)), nil)
插件,之后我立即收到错误。
错误500
我通过FTP删除了模块文件夹,并在 prestashop 上激活了chechout
模式,现在我收到了这个错误:
致命错误:未捕获 - > Smarty:插件标签"逃脱"已经 注册< - 抛入 /home/user/public_html/vendor/prestashop/smarty/sysplugins/smarty_internal_templatebase.php 在第449行
请帮助我,我不知道该怎么做,这是我第一次使用prestashop,而且我的商店已经有1000多篇文章了。
代码:
DEBUG
答案 0 :(得分:1)
首先,您不应该从FTP中删除模块。它可以创建表格,覆盖等,如果您从FTP中删除它并且不能正确卸载它,它将保留。
因此,只要您恢复后台,就应该再次上传模块并从后台卸载它。
检测导致错误的人
Fatal error: Uncaught --> Smarty: Plugin tag "escape" already registered <-- thrown in /home/user/public_html/vendor/prestashop/smarty/sysplugins/smarty_internal_templatebase.php on line 449
您可以在此文件中添加此代码:
public function registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = null)
{
if (isset($this->smarty->registered_plugins[$type][$tag])) {
//This code will throw the caller function
$e = new Exception;
var_dump($e->getTraceAsString());
throw new SmartyException("Plugin tag \"{$tag}\" already registered");
} elseif (!is_callable($callback)) {
throw new SmartyException("Plugin \"{$tag}\" not callable");
} else {
$this->smarty->registered_plugins[$type][$tag] = array($callback, (bool) $cacheable, (array) $cache_attr);
}
return $this;
}
一旦您知道导致错误的人,您必须在注册之前验证插件是否已注册:
if (!isset($this->context->smarty->registered_plugins['function']['escape'])) {
$this->context->smarty->registerPlugin('function', 'escape', array($lazyRegister, 'escape'));
}
编辑:
如果错误来自模块escapePTS
的插件标记onepagecheckoutps
,请替换以下行:
smartyRegisterFunction($smarty, "modifier", "escape", "escapePTS");
来自档案/classes/OnePageCheckoutPSCore.php
使用:
if (!isset($this->context->smarty->registered_plugins['modifier'}['escape'])) {
smartyRegisterFunction($smarty, "modifier", "escape", "escapePTS");
}
答案 1 :(得分:0)
更改此:
exports.createStore = async(req, res) => {
var store = new Store(req.body);
req.checkBody('age', 'Age cannot be blank').notEmpty();
var errors = req.validationErrors();
if (errors) {
res.render('WebPage', {
title: 'Webpage Title',
errors: errors,
formData: {
age: req.body.age
}
});
} else {
//Do all the things
}
}
对此:
smartyRegisterFunction($smarty, "modifier", "escape", "escapePTS");
答案 2 :(得分:0)
我刚刚移走
//CODE MODULES PRESTEAMSHOP - PLEASE NOT REMOVE
//--------------------------------------------------------------------------------------------------------
smartyRegisterFunction($smarty, "modifier", "escape", "escapePTS");
function escapePTS($string, $esc_type = "html", $char_set = null, $double_encode = true, $as_html = false)
{
$smarty_escape = SMARTY_PLUGINS_DIR."modifier.escape.php";
include_once $smarty_escape;
if (!$as_html && is_callable("smarty_modifier_escape")) {
$string = call_user_func("smarty_modifier_escape", $string, $esc_type, $char_set, $double_encode);
}
return $string;
}
//--------------------------------------------------------------------------------------------------------
从文件/config/smarty.config.inc.php的末尾开始,现在可以正常工作了。 但是对我来说,模块安装未成功,模块未安装。