dongyong1942 2015-12-23 05:38
浏览 91

未定义的属性:Loader :: $ load

Ok, The site is working fine but I've installed a new module and I'm receiving this error when trying to access the admin login now. I cannot login to the admin. I am a beginner level coder.

Notice: Undefined property: Loader::$load in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-admin_view_template_common_header.tpl on line 96 Fatal error: Call to a member function model() on a non-object in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-admin_view_template_common_header.tpl on line 96

I was able to find this file (admin_view_template_common_header.tpl) in my FTP. I opened it in Sublime Text Editor and line 96 shows this code

<?php $this->load->model('multiseller/upgrade'); ?>

Below is the full code of the entire admin_view_template_common_header.tpl file

<!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 Take me to what I believe may be very similar.

If this is the case, How do I find

function __construct()
{
    parent::__construct();
    /*Additional code which you want to run automatically in every function       call */
}

********UPDATE******** After following the suggestion and changing the code, this error now appears

Warning: Missing argument 1 for Loader::__construct(), called in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-admin_view_template_common_header.tpl on line 96 and defined in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-system_engine_loader.php on line 14Notice: Undefined variable: registry in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-system_engine_loader.php on line 15Notice: Undefined variable: registry in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-system_engine_loader.php on line 18 Fatal error: Call to a member function set() on a non-object in /hermes/walnaweb03a/b905/moo.mattestincom/peddlerplace/osclass/shop/vqmod/vqcache/vq2-system_engine_loader.php on line 18

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);
}

}

  • 写回答

2条回答 默认 最新

  • dqmnueuu459279 2015-12-23 05:58
    关注

    In new version of OC we can't load any access the library on template files, to do it we have to load that first & then we can use it. Please try this code on line no 96

    $load = new Loader();
    $load->model('multiseller/upgrade'); 
    

    Instead of $this->load->model('multiseller/upgrade');

    评论

报告相同问题?

悬赏问题

  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测