Skip to content

Commit

Permalink
Update editor.php
Browse files Browse the repository at this point in the history
When a bad coded or outdated (i.e.) non-compatible plugin is installed you cannot open the editor and an error is shown "Call to undefined method stdClass::onDisplay() Error". Only 2 fields are visible "Name and Alias". I posted the entire issue on https://groups.google.com/forum/#!searchin/joomla-dev-cms/$2Flibraries$2Fcms$2Feditor$2Feditor.php/joomla-dev-cms/-2EPgbbNn78/7LKB3_5Ah8IJ and will post also a Tracker item shortly. 

The code change checks to see if the class method named “onDisplay” exists before attempting to use it but will pass without throwing the error 

Leo Lammerink
MD GWS-Desk.com
  • Loading branch information
gwsdesk committed Feb 23, 2014
1 parent 19b1721 commit ebd7108
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/cms/editor/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ public function getButtons($editor, $buttons = true)
}

// Try to authenticate
if ($temp = $plugin->onDisplay($editor, $this->asset, $this->author))
if (method_exists($plugin, 'onDisplay') && $temp = $plugin->onDisplay($editor, $this->asset, $this->author))
{
$result[] = $temp;
}
Expand Down

0 comments on commit ebd7108

Please sign in to comment.