diff --git a/api/src/Hooks.php b/api/src/Hooks.php index 525c5030a8..278e1a9b01 100644 --- a/api/src/Hooks.php +++ b/api/src/Hooks.php @@ -98,7 +98,7 @@ class Hooks * @param boolean $try_unregistered =false If true, try to include old file-hook anyway (for setup) * @return mixed False if no hook exists, True if old hook exists and whatever the new method-hook returns (can be True or False too!). */ - public static function single($args, $appname = '', $no_permission_check = False)//,$try_unregistered = False) + public static function single($args, $appname = '', $no_permission_check = False, $try_unregistered = False) { //error_log(__METHOD__."(".array2string($args).",'$appname','$no_permission_check','$try_unregistered')"); @@ -151,6 +151,13 @@ class Hooks } } + // hooks only existing in filesystem used by setup + if (!$ret && $try_unregistered && file_exists(EGW_SERVER_ROOT.($hook='/'.$appname.'/inc/hook_'.$location.'.inc.php'))) + { + include(EGW_SERVER_ROOT.$hook); + return true; + } + if (!$ret) return false; return count($ret) == 1 ? $ret[0] : $ret;