From d1e1683ba4f9e2808b86f507c2302a53525378eb Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 31 Oct 2014 12:24:19 +0000 Subject: [PATCH] only register hooks of installed apps, not all existing in filesystem, fixes fatal errors resulting from not installed apps --- phpgwapi/inc/class.hooks.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.hooks.inc.php b/phpgwapi/inc/class.hooks.inc.php index 2511fbb203..033fea31cf 100644 --- a/phpgwapi/inc/class.hooks.inc.php +++ b/phpgwapi/inc/class.hooks.inc.php @@ -329,8 +329,15 @@ class hooks // deleting hooks, to get ride of no longer existing apps $this->db->delete($this->table,'1=1',__LINE__,__FILE__); + // if we run in setup, we need to read installed apps first + if (!$GLOBALS['egw_info']['apps']) + { + $applications = new applications(); + $applications->read_installed_apps(); + } + // now register all apps using just filesystem data - foreach(scandir(EGW_SERVER_ROOT) as $appname) + foreach(array_keys($GLOBALS['egw_info']['apps']) as $appname) { if ($appname[0] == '.' || !is_dir(EGW_SERVER_ROOT.'/'.$appname)) continue;