好的,该网站运行正常,但我已经安装了一个新模块,我现在尝试访问管理员登录时收到此错误。我无法登录管理员。我是初级级编码员。
注意:第96行的/hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-admin_view_template_common_header.tpl中未定义的属性:Loader :: $ load 致命错误:在第96行的/hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-admin_view_template_common_header.tpl中调用非对象上的成员函数model()
我能够在FTP中找到此文件(admin_view_template_common_header.tpl)。我在Sublime Text Editor中打开它,第96行显示了这段代码
<?php $this->load->model('multiseller/upgrade'); ?>
以下是整个admin_view_template_common_header.tpl文件的完整代码
<!DOCTYPE html>
<html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>">
<head>
<meta charset="UTF-8" />
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<script type="text/javascript" src="view/javascript/jquery/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="view/javascript/bootstrap/js/bootstrap.min.js"></script>
<link href="view/stylesheet/bootstrap.css" type="text/css" rel="stylesheet" />
<link href="view/javascript/font-awesome/css/font-awesome.min.css" type="text/css" rel="stylesheet" />
<link href="view/javascript/summernote/summernote.css" rel="stylesheet" />
<script type="text/javascript" src="view/javascript/summernote/summernote.js"></script>
<script src="view/javascript/jquery/datetimepicker/moment.js" type="text/javascript"></script>
<script src="view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<link href="view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css" type="text/css" rel="stylesheet" media="screen" />
<link type="text/css" href="view/stylesheet/stylesheet.css" rel="stylesheet" media="screen" />
<?php foreach ($styles as $style) { ?>
<link type="text/css" href="<?php echo $style['href']; ?>" rel="<?php echo $style['rel']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
<?php foreach ($links as $link) { ?>
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>
<script src="view/javascript/common.js" type="text/javascript"></script>
<?php global $config; $this->config = $config; ?>
<script type="text/javascript"> if (!window.console) console = {log: function() {}}; var msGlobals = { config_limit_admin: '<?php echo $this->config->get('config_limit_admin'); ?>', config_language: <?php echo $dt_language; ?> }; </script>
<?php foreach ($scripts as $script) { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>
</head>
<body>
<div id="container">
<header id="header" class="navbar navbar-static-top">
<div class="navbar-header">
<?php if ($logged) { ?>
<a type="button" id="button-menu" class="pull-left"><i class="fa fa-indent fa-lg"></i></a>
<?php } ?>
<a href="<?php echo $home; ?>" class="navbar-brand"><img src="view/image/logo.png" alt="<?php echo $heading_title; ?>" title="<?php echo $heading_title; ?>" /></a></div>
<?php if ($logged) { ?>
<ul class="nav pull-right">
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown"><span class="label label-danger pull-left"><?php echo $alerts; ?></span> <i class="fa fa-bell fa-lg"></i></a>
<ul class="dropdown-menu dropdown-menu-right alerts-dropdown">
<li class="dropdown-header"><?php echo $text_order; ?></li>
<li><a href="<?php echo $processing_status; ?>" style="display: block; overflow: auto;"><span class="label label-warning pull-right"><?php echo $processing_status_total; ?></span><?php echo $text_processing_status; ?></a></li>
<li><a href="<?php echo $complete_status; ?>"><span class="label label-success pull-right"><?php echo $complete_status_total; ?></span><?php echo $text_complete_status; ?></a></li>
<li><a href="<?php echo $return; ?>"><span class="label label-danger pull-right"><?php echo $return_total; ?></span><?php echo $text_return; ?></a></li>
<li class="divider"></li>
<li class="dropdown-header"><?php echo $text_customer; ?></li>
<li><a href="<?php echo $online; ?>"><span class="label label-success pull-right"><?php echo $online_total; ?></span><?php echo $text_online; ?></a></li>
<li><a href="<?php echo $customer_approval; ?>"><span class="label label-danger pull-right"><?php echo $customer_total; ?></span><?php echo $text_approval; ?></a></li>
<li class="divider"></li>
<li class="dropdown-header"><?php echo $text_product; ?></li>
<li><a href="<?php echo $product; ?>"><span class="label label-danger pull-right"><?php echo $product_total; ?></span><?php echo $text_stock; ?></a></li>
<li><a href="<?php echo $review; ?>"><span class="label label-danger pull-right"><?php echo $review_total; ?></span><?php echo $text_review; ?></a></li>
<li class="divider"></li>
<li class="dropdown-header"><?php echo $text_affiliate; ?></li>
<li><a href="<?php echo $affiliate_approval; ?>"><span class="label label-danger pull-right"><?php echo $affiliate_total; ?></span><?php echo $text_approval; ?></a></li>
</ul>
</li>
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-life-ring fa-lg"></i></a>
<ul class="dropdown-menu dropdown-menu-right">
<li class="dropdown-header"><?php echo $text_store; ?> <i class="fa fa-shopping-cart"></i></li>
<?php foreach ($stores as $store) { ?>
<li><a href="<?php echo $store['href']; ?>" target="_blank"><?php echo $store['name']; ?></a></li>
<?php } ?>
<li class="divider"></li>
<li class="dropdown-header"><?php echo $text_help; ?> <i class="fa fa-life-ring"></i></li>
<li><a href="http://www.opencart.com" target="_blank"><?php echo $text_homepage; ?></a></li>
<li><a href="http://docs.opencart.com" target="_blank"><?php echo $text_documentation; ?></a></li>
<li><a href="http://forum.opencart.com" target="_blank"><?php echo $text_support; ?></a></li>
</ul>
</li>
<li><a href="<?php echo $logout; ?>"><span class="hidden-xs hidden-sm hidden-md"><?php echo $text_logout; ?></span> <i class="fa fa-sign-out fa-lg"></i></a></li>
</ul>
<?php } ?>
</header>
<?php if (!class_exists('ControllerMultisellerBase')) { ?>
<div class="alert alert-warning" style="margin: 10px auto; width: 90%;"><i class="fa fa-exclamation-circle"></i> MultiMerch Core Class not found. Before proceeding with the installation, please make sure that:
<ul>
<li>You're <a target="_blank" href="http://multimerch.com/docs/installation/">following the MultiMerch installation guide</a> and all MultiMerch files have been uploaded correctly.</li>
<li>vQmod is <a target="_blank" href="https://github.com/vqmod/vqmod/wiki/Installing-vQmod-on-OpenCart">installed and configured correctly</a> and vQmod installation script at <a target="_blank" href="<?php echo HTTP_CATALOG; ?>vqmod/install/"><?php echo HTTP_CATALOG; ?>vqmod/install/</a> has been run.</li>
<li>Your server has write permissions on vQmod folders.</li>
</ul>
</div>
<?php } ?>
<?php $this->load->model('multiseller/upgrade'); ?>
<?php if ($this->MsLoader->MsHelper->isInstalled() && !$this->model_multiseller_upgrade->isDbLatest()) { ?>
<div class="alert-warning" style="text-align:center; margin: 10px"><?php echo sprintf($this->language->get('ms_db_upgrade'), $this->url->link('module/multiseller/upgradeDb', 'token=' . $this->session->data['token'], 'SSL')); ?></div>
<?php } ?>
<?php if (isset($this->session->data['ms_db_latest'])) { ?>
<div class="alert-success" style="text-align:center; margin: 10px"><?php echo $this->session->data['ms_db_latest']; ?></div>
<?php unset($this->session->data['ms_db_latest']); ?>
<?php } ?>
Error: undefined property $load 带我去看我认为可能非常相似的东西。
如果是这种情况,我该如何找到
function __construct()
{
parent::__construct();
/*Additional code which you want to run automatically in every function call */
}
******** ******** UPDATE 按照建议并更改代码后,现在出现此错误
警告:缺少Loader :: __ construct()的参数1,在第96行的/hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-admin_view_template_common_header.tpl中调用并在/hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-system_engine_loader.php在线14Notice:未定义的变量:在/hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/注册表店/ vqmod / vqcache /上线15Notice VQ2-system_engine_loader.php:未定义变量:注册表中/hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-system_engine_loader.php线路18上致命错误:在第18行的/hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-system_engine_loader.php中调用非对象上的成员函数set()
private $registry;
public function __construct($registry) {
$this->registry = $registry;
require_once(VQMod::modCheck(VQMod::modCheck(DIR_SYSTEM . 'library/msloader.php')));
$registry->set('MsLoader', new MsLoader($registry));
}
public function controller($route, $data = array()) {
// $this->event->trigger('pre.controller.' . $route, $data);
$parts = explode('/', str_replace('../', '', (string)$route));
// Break apart the route
while ($parts) {
$file = DIR_APPLICATION . 'controller/' . implode('/', $parts) . '.php';
$class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', implode('/', $parts));
if (is_file($file)) {
include_once(VQMod::modCheck($file));
break;
} else {
$method = array_pop($parts);
}
}
$controller = new $class($this->registry);
if (!isset($method)) {
$method = 'index';
}
// Stop any magical methods being called
if (substr($method, 0, 2) == '__') {
return false;
}
$output = '';
if (is_callable(array($controller, $method))) {
$output = call_user_func(array($controller, $method), $data);
}
// $this->event->trigger('post.controller.' . $route, $output);
return $output;
}
public function model($model, $data = array()) {
// $this->event->trigger('pre.model.' . str_replace('/', '.', (string)$model), $data);
$model = str_replace('../', '', (string)$model);
$file = DIR_APPLICATION . 'model/' . $model . '.php';
$class = 'Model' . preg_replace('/[^a-zA-Z0-9]/', '', $model);
if (file_exists($file)) {
include_once(VQMod::modCheck($file));
$this->registry->set('model_' . str_replace('/', '_', $model), new $class($this->registry));
} else {
trigger_error('Error: Could not load model ' . $file . '!');
exit();
}
// $this->event->trigger('post.model.' . str_replace('/', '.', (string)$model), $output);
}
public function view($template, $data = array()) {
// $this->event->trigger('pre.view.' . str_replace('/', '.', $template), $data);
$file = DIR_TEMPLATE . $template;
if (file_exists($file)) {
extract($data);
ob_start();
require(VQMod::modCheck($file));
$output = ob_get_contents();
ob_end_clean();
} else {
trigger_error('Error: Could not load template ' . $file . '!');
exit();
}
// $this->event->trigger('post.view.' . str_replace('/', '.', $template), $output);
return $output;
}
public function helper($helper) {
$file = DIR_SYSTEM . 'helper/' . str_replace('../', '', (string)$helper) . '.php';
if (file_exists($file)) {
include_once(VQMod::modCheck($file));
} else {
trigger_error('Error: Could not load helper ' . $file . '!');
exit();
}
}
public function config($config) {
$this->registry->get('config')->load($config);
}
public function language($language) {
return $this->registry->get('language')->load($language);
}
}
答案 0 :(得分:0)
在新版本的OC中,我们无法加载对模板文件库的任何访问权限,为此我们必须首先加载该模板文件。然后我们可以使用它。 请在第96行试用此代码
$load = new Loader();
$load->model('multiseller/upgrade');
而不是$this->load->model('multiseller/upgrade');
答案 1 :(得分:0)
我回答这个问题可能有点迟了,但这实际上是由MultiMerch和Journal与旧版MultiMerch-Journal集成包的组合设置引起的。
如果其他人遇到同样的问题,请将您的期刊兼容包更新为可用的最新版本in our GitHub repo。