Skip to content
Snippets Groups Projects
Commit 8cb3706d authored by Michael Hamann's avatar Michael Hamann
Browse files

Fix nested triggering of the same event

Previously when in an event handler the same event was triggered again,
only the handlers for the second event invocation were all executed, the
handling of the "outer" event stopped after the handling of the inner
event as they both used the same iterator of the hooks array. This
caused caching bugs e.g. when both the include and the indexmenu plugin
were enabled as both of them load metadata in the cache handler which
triggers another renderer cache event.
parent 2daedc0b
No related branches found
No related tags found
No related merge requests found
......@@ -158,8 +158,7 @@ class Doku_Event_Handler {
$evt_name = $event->name . ($advise ? '_'.$advise : '_BEFORE');
if (!empty($this->_hooks[$evt_name])) {
$hook = reset($this->_hooks[$evt_name]);
do {
foreach ($this->_hooks[$evt_name] as $hook) {
// list($obj, $method, $param) = $hook;
$obj =& $hook[0];
$method = $hook[1];
......@@ -171,7 +170,8 @@ class Doku_Event_Handler {
$obj->$method($event, $param);
}
} while ($event->_continue && $hook = next($this->_hooks[$evt_name]));
if (!$event->_continue) break;
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment