diff --git a/libraries/joomla/event/dispatcher.php b/libraries/joomla/event/dispatcher.php index 260f4b73f7500..ab1df5614b60c 100644 --- a/libraries/joomla/event/dispatcher.php +++ b/libraries/joomla/event/dispatcher.php @@ -204,7 +204,6 @@ public function attach($observer) } $this->_observers[] = $observer; - end($this->_observers); $methods = array($observer['event']); } else @@ -229,6 +228,7 @@ public function attach($observer) $methods = array_diff(get_class_methods($observer), get_class_methods('JPlugin')); } + end($this->_observers); $key = key($this->_observers); foreach ($methods as $method)