【问题标题】:Fatal error: Call to a member function load() on a non-object Joomla致命错误:在非对象 Joomla 上调用成员函数 load()
【发布时间】:2013-06-12 11:19:31
【问题描述】:

我有 Joomla! 1.7.2 稳定,当我尝试登录管理区域时出现此错误

 Fatal error: Call to a member function load() on a non-object in /home/shomos1/public_html/portal/libraries/joomla/user/user.php on line 822

这是我的 user.php 中的错误行

    public function load($id)
    {
        // Create the user table object

        $table  = $this->getTable();
var_dump($table);
        // Load the JUserModel object based on the user id or throw a warning.
        if (!$table->load($id)) {
            JError::raiseWarning('SOME_ERROR_CODE', JText::sprintf('JLIB_USER_ERROR_UNABLE_TO_LOAD_USER', $id));
            return false;
        }

        // Set the user parameters using the default XML file.  We might want to
        // extend this in the future to allow for the ability to have custom
        // user parameters, but for right now we'll leave it how it is.

        $this->_params->loadString($table->params);

        // Assuming all is well at this point lets bind the data
        $this->setProperties($table->getProperties());

        return true;
    }
}

我不擅长 Joomla,我不明白那里有什么问题 请需要帮助我该怎么做才能解决这个问题 谢谢

【问题讨论】:

  • 此时$table设置了什么?
  • 很抱歉我没有让你知道如何知道 $table set 如何检查的问题
  • 好的对不起你的意思是这个 $table = $this->getTable();
  • 错误是:getTable() 不应返回 false。但是我不明白为什么,当查看源代码时:joomlacode.org/gf/project/joomla/scmsvn/… 抱歉;我帮不了你:-(
  • 是的,我也没有看到false 返回值的来源。在我看来,如果是这种情况,代码应该检查!empty($table)

标签: php joomla


【解决方案1】:

默认的 com_user 组件与您的组件冲突,因此您必须重命名您的组件文件,它们不得具有名称“用户”...

【讨论】:

    猜你喜欢
    • 2014-05-06
    • 1970-01-01
    • 2013-11-25
    • 2012-05-30
    • 2016-08-30
    • 2015-02-06
    • 2012-05-14
    • 2013-11-19
    • 2017-04-30
    相关资源
    最近更新 更多