-2

I have a joomla 2.5 installation. I just installed community builder component. when I tried to add a field, I got the error message: Fatal error: Call to undefined method stdClass::onDisplay() in /home/sharpfoc/public_html/joomla16/libraries/joomla/html/editor.php on line 459 if anybody has a clue on how to solve this issue, it will be appreciated. thanks. souleye

Souleye
  • 9
  • 1
  • 2
  • what are we supposed to tell you now other than what the error message already told you? You have a [generic object](http://de.php.net/manual/de/language.types.object.php) and try to call a method on it that it doesnt have. So pull out your debugger and step through your code to find out what's happening. In order to make a qualified guess, we'd at least need to see line 459 and some surrounding/calling code. – Gordon Jun 28 '12 at 16:43

1 Answers1

3

Edit the file “editor.php” in the folder libraries/joomla/html

Replaced the line

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

which is in line 261* after the line

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

to

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

It worked for me. Hope it will work for you too

Gordon
  • 312,688
  • 75
  • 539
  • 559
Abel Jojo
  • 758
  • 3
  • 14
  • 30
  • 1
    only fixes symptoms and not the root cause but I guess it's useful, so +1 – Gordon Jun 28 '12 at 16:56
  • the offending line of code is: // Try to authenticate if ($temp = $plugin->onDisplay($editor, $this->asset, $this->author)) { $result[] = $temp; } – Souleye Jun 28 '12 at 18:13
  • Looks like some plugin did not load. – hakre Jun 28 '12 at 21:41
  • Change line 268 of /libraries/joomla/html/editor.php from: `$resultTest = $plugin->onDisplay($editor);` To: `// $resultTest = $plugin->onDisplay($editor); if (method_exists($plugin, 'onDisplay')) { $result[] = $plugin->onDisplay($editor); if ($resultTest) $result[] = $resultTest; } else{ $resultTest = false; echo '

    Bad Plugin: '.$plugin->name.'

    '; }` This will get rid of the error, and also show you what plugin is not properly installed so you can reinstall it (in my case it was "Modules Anywhere").
    – FirstFraktal Jan 18 '16 at 23:23
  • This issue is definitely related to some editor plugin missing the 'onDisplay' method. So you should check all of your `editor-xtd` type plugins. A cause of such issue in plugin could be that the plugins are outdated, so updating the plugins could fix this issue. – Ejaz Feb 07 '16 at 14:07