diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-03-14 15:59:27 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-03-14 15:59:27 +0100 |
commit | b97c855c71e194de287fe426d3a85a41405e627f (patch) | |
tree | 4f2795116e2b5ac7a83b146b8ed6d6cee338ea86 /inc | |
parent | c6fcd0ad055d82fceae05cda6e1281b7125d69d0 (diff) | |
parent | 882bc5d2afc0dfa289e35bc1ec6c99d54ead7660 (diff) | |
download | rpg-b97c855c71e194de287fe426d3a85a41405e627f.tar.gz rpg-b97c855c71e194de287fe426d3a85a41405e627f.tar.bz2 |
Merge pull request #615 from splitbrain/event_warning
Events: Trigger a warning if the default action is not callable
Diffstat (limited to 'inc')
-rw-r--r-- | inc/events.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/inc/events.php b/inc/events.php index 7f9824f60..318a7617e 100644 --- a/inc/events.php +++ b/inc/events.php @@ -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)) { |