You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dispatcher passes the event name instead of the event object to later listeners #475
In w2p_System_Dispatcher::publish() the wildcard-resource loop reuses the parameter name:
foreach ($this->_listeners['*'] as$event => $listeners) {
if ($event == $eventName) {
foreach ($listenersas$listener) {
$listener->publish($event); // a string, not the event
After this loop $event holds the last event name (a string), so it is also what the later resource-specific loops pass to their listeners. BaseObject::publish(w2p_System_Event $event) would then throw a TypeError.
Nothing subscribes with resource * today (each BaseObject only subscribes itself to its own class), so this is latent. The change-capture listener in the API proposal subscribes to every resource, so it would hit this immediately.
Fix: rename the loop variable ($name => $listeners).
Found by reading the code on dev-5.0.0 @ 179b4eaf; not yet reproduced on a running install.
Activity