From ebd710824a3921e05fc8ef09d5af75830c9e321b Mon Sep 17 00:00:00 2001 From: gwsdesk Date: Sun, 23 Feb 2014 15:36:35 +0700 Subject: [PATCH] Update editor.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- libraries/cms/editor/editor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/cms/editor/editor.php b/libraries/cms/editor/editor.php index 32f8b1423b525..7defe941d9641 100644 --- a/libraries/cms/editor/editor.php +++ b/libraries/cms/editor/editor.php @@ -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; }