From ccb408af27830b8156ded210272c00c268f329ce Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 16 Nov 2009 09:44:20 +0000 Subject: [PATCH] "let new method hooks fail gracefully if hook class-file does not exists (like the old hooks do, eg. if app got removed)" --- phpgwapi/inc/class.hooks.inc.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.hooks.inc.php b/phpgwapi/inc/class.hooks.inc.php index b947e6c426..5c63926e27 100644 --- a/phpgwapi/inc/class.hooks.inc.php +++ b/phpgwapi/inc/class.hooks.inc.php @@ -158,7 +158,18 @@ class hooks if (strpos($method,'::') !== false || count($parts) == 3 && $parts[1] != 'inc' && $parts[2] != 'php') { // new style hook with method string or static method (eg. 'class::method') - return ExecMethod($method,$args); + try + { + return ExecMethod($method,$args); + } + catch(egw_exception_assertion_failed $e) + { + if (substr($e->getMessage(),-19) == '.inc.php not found!') + { + return false; // fail gracefully if hook class-file does not exists (like the old hooks do, eg. if app got removed) + } + throw $e; + } } else {