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

Events: Trigger a warning if the default action is not callable

This adds a warning in the case that the default action is not null but
also not callable which can happen when the supplied method is not
public.
parent a8795974
No related branches found
No related tags found
No related merge requests found
......@@ -93,7 +93,12 @@ class Doku_Event {
*/
function trigger($action=null, $enablePrevent=true) {
if (!is_callable($action)) $enablePrevent = false;
if (!is_callable($action)) {
$enablePrevent = false;
if (!is_null($action)) {
trigger_error('The default action of '.$this.' is not null but also not callable. Maybe the method is not public?', E_USER_WARNING);
}
}
if ($this->advise_before($enablePrevent) && is_callable($action)) {
if (is_array($action)) {
......
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