User tests: Successful: Unsuccessful:
will be unsynced with the methods array.
When a custom plugin loaded by:
JPluginHelper::importPlugin('test', 'mytestplugin');
There is an indexing issue in JEventDispatcher::attach method. The $observer parameter is NOT array, so it skip into the else state and there is a missing end pointer setup on the $this->_observers array. So when the next step get out key($this->_observers), it gets the previous plugin index, which will result failer of the loaded plugin.
Old code:
$this->_observers[] = $observer;
$methods = array_diff(get_class_methods($observer), get_class_methods('JPlugin'));
The code should be like this:
$this->_observers[] = $observer;
$methods = array_diff(get_class_methods($observer), get_class_methods('JPlugin'));
end($this->_observers);
Great! It is nice to see that it will be part of the core Joomla, soon...
Here is a tracker item that describes this in a different way and is a bit more verbose: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=31072&start=0
Closing the other as duplicate of this one.
Status | New | ⇒ | Pending |
Build | ⇒ | . |
Category | ⇒ | Libraries |
Closed as fixed elsewhere. Thanks!
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-10-17 14:15:08 |
Title |
|
I've proposed a slightly better code. When you merge that into your PR, I'm going to get this a little bit more attention and we can hopefully merge this soon. :-)