summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2014-03-14 13:05:03 +0100
committerMichael Hamann <michael@content-space.de>2014-03-14 13:05:03 +0100
commitbc2ddb548f71b1a822dd03c3bc7c3c0e7cd9b152 (patch)
tree9e962ad8e02632cd040fc19b5d8ce49bfff1e372
parenta8795974051a91137b01ff88dbf5586a647b24ce (diff)
downloadrpg-bc2ddb548f71b1a822dd03c3bc7c3c0e7cd9b152.tar.gz
rpg-bc2ddb548f71b1a822dd03c3bc7c3c0e7cd9b152.tar.bz2
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.
-rw-r--r--inc/events.php7
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)) {