Skip to content
Snippets Groups Projects
Commit b97c855c authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Merge pull request #615 from splitbrain/event_warning

Events: Trigger a warning if the default action is not callable
parents c6fcd0ad 882bc5d2
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