Php 致命错误:如果我在prestashop中用另一种语言设置站点,则调用成员函数assign()时为null

Php 致命错误:如果我在prestashop中用另一种语言设置站点,则调用成员函数assign()时为null,php,prestashop,Php,Prestashop,如果我用另一种语言(英语、西班牙语或法语)设置站点,标题菜单和购物车不起作用,但一旦我重新加载该页面,错误将完全隐藏并显示页面 我遇到以下错误: 致命错误:在null上调用成员函数assign() 我的代码如下: classes\module\module.php public function display($file, $template, $cache_id = null, $compile_id = null) { if (($overloaded = Module::_isT

如果我用另一种语言(英语、西班牙语或法语)设置站点,标题菜单和购物车不起作用,但一旦我重新加载该页面,错误将完全隐藏并显示页面

我遇到以下错误:

致命错误:在null上调用成员函数assign()

我的代码如下:

classes\module\module.php

public function display($file, $template, $cache_id = null, $compile_id = null)
{
    if (($overloaded = Module::_isTemplateOverloadedStatic(basename($file, '.php'), $template)) === null) {
        return Tools::displayError('No template found for module').' '.basename($file, '.php');
    } else {
        if (Tools::getIsset('live_edit') || Tools::getIsset('live_configurator_token')) {
            $cache_id = null;
        }

        $this->smarty->assign(array(
            'module_dir' =>    __PS_BASE_URI__.'modules/'.basename($file, '.php').'/',
            'module_template_dir' => ($overloaded ? _THEME_DIR_ : __PS_BASE_URI__).'modules/'.basename($file, '.php').'/',
            'allow_push' => $this->allow_push
        ));

        if ($cache_id !== null) {
            Tools::enableCache();
        }

        $result = $this->getCurrentSubTemplate($template, $cache_id, $compile_id)->fetch();

        if ($cache_id !== null) {
            Tools::restoreCacheSettings();
        }

        $this->resetCurrentSubTemplate($template, $cache_id, $compile_id);

        return $result;
    }
}

$this->smarty
为空。发现why@Federkun感谢您给我宝贵的时间,当我打印时,我得到了值,也得到了错误,但当我重新加载页面错误将被删除,我看到了页面内容