From 9851b5cd46277b43e69dacaf717f9e6544d27ed3 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 3 May 2010 08:19:32 +0000 Subject: [PATCH] handle warning on install --- phpgwapi/inc/class.hooks.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.hooks.inc.php b/phpgwapi/inc/class.hooks.inc.php index f713c0f7b9..e5919caaa0 100644 --- a/phpgwapi/inc/class.hooks.inc.php +++ b/phpgwapi/inc/class.hooks.inc.php @@ -97,12 +97,13 @@ class hooks $location = is_array($args) ? $args['location'] : $args; $hooks = $this->locations[$location]; - if (!isset($hooks)) return array(); // not a single app implements that hook + if (!isset($hooks) || empty($hooks)) return array(); // not a single app implements that hook $apps = array_keys($hooks); if (!$no_permission_check) { - $apps = array_intersect($apps,array_keys($GLOBALS['egw_info']['user']['apps'])); + // on install of a new egroupware both hook-apps and user apps may be empty/not set + $apps = array_intersect((array)$apps,(array)array_keys($GLOBALS['egw_info']['user']['apps'])); } if ($order) {