User tests: Successful: Unsuccessful:
4.0 ships with the Framework event dispatcher which uses an event object based approach with the legacy implementation of events through JEvent
and JEventDispatcher
in 3.x is still supported throughout the 4.x lifecycle. This allows the CMS to work in a "mixed" state where plugins can listen to events with both syntaxes and events can be dispatched through both syntaxes.
As a demonstration of this, the onGetIcons
event dispatched from the admin mod_quickicon
is converted to dispatching a GetQuickIconsEvent
event object versus the legacy way of dispatching events with a plain array of arguments. The advantage of using event objects is you now have a more crystal clear expectation of what you're getting when an event is dispatched; since your listener is now receiving a PHP class object, it will have an API that can followed to determine what the event arguments are and what types of data exist in them.
Plugins, through our event package's Joomla\Event\SubscriberInterface
, can now also explicitly declare the events that they support and can map those listeners to any method in the class. I've changed the Joomla! Update quick icon plugin to make use of this new structure, demonstrating the subscriber implementation and how a listener receives an event object versus the event arguments as method parameters.
I've purposefully not touched the other quick icon plugins to demonstrate how the compatibility layer just works.
With this patch applied, the Joomla update check icon should still display correctly on the admin dashboard.
N/A
Status | New | ⇒ | Pending |
Category | ⇒ | Modules Administration Front End Plugins |
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-25 12:30:34 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|