【问题标题】:Call to undefined method stdClass::onDisplay() error [closed]调用未定义的方法 stdClass::onDisplay() 错误 [关闭]
【发布时间】:2012-06-28 16:39:44
【问题描述】:

我有一个 joomla 2.5 安装。我刚刚安装了社区构建器组件。当我尝试添加一个字段时,我收到了错误消息: 致命错误:在第 459 行的 /home/sharpfoc/public_html/joomla16/libraries/joomla/html/editor.php 中调用未定义的方法 stdClass::onDisplay() 如果有人知道如何解决这个问题,我们将不胜感激。谢谢。 灵魂之眼

【问题讨论】:

  • 除了错误消息已经告诉您的内容之外,我们现在还应该告诉您什么?你有一个generic object 并尝试调用它没有的方法。因此,拉出您的调试器并单步执行您的代码以找出发生了什么。为了做出合格的猜测,我们至少需要查看第 459 行和一些周围/调用代码。

标签: php joomla2.5 stdclass


【解决方案1】:

编辑文件夹libraries/joomla/html中的“editor.php”文件

换行

  $resultTest = $plugin->onDisplay($editor);

在第 261* 行之后

// Try to authenticate — only add to array if authentication is successful

 if (method_exists($plugin, 'onDisplay')) {
     $result[] = $plugin->onDisplay($editor);
 }

它对我有用。希望它也对你有用

【讨论】:

  • 只修复症状而不是根本原因,但我想它很有用,所以+1
  • 有问题的代码行是: // 尝试验证 if ($temp = $plugin->onDisplay($editor, $this->asset, $this->author)) { $result [] = $临时; }
  • 好像有些插件没有加载。
  • 将 /libraries/joomla/html/editor.php 的第 268 行从:$resultTest = $plugin->onDisplay($editor); 更改为:// $resultTest = $plugin->onDisplay($editor); if (method_exists($plugin, 'onDisplay')) { $result[] = $plugin->onDisplay($editor); if ($resultTest) $result[] = $resultTest; } else{ $resultTest = false; echo '<h4>Bad Plugin: '.$plugin->name.'</h4>'; } 这将消除错误,并显示未正确安装的插件所以你可以重新安装它(在我的例子中是“Modules Anywhere”)。
  • 这个问题肯定与某些编辑器插件缺少'onDisplay'方法有关。所以你应该检查你所有的editor-xtd 类型的插件。插件中出现此类问题的原因可能是插件已过时,因此更新插件可以解决此问题。
猜你喜欢
  • 2012-04-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-04-17
  • 2016-05-08
  • 2019-07-19
  • 1970-01-01
相关资源
最近更新 更多