From 95906905e4b254acd4f691b9299417b28f281cc8 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Wed, 12 Jan 2011 10:55:03 +0000 Subject: [PATCH] fix for bug in register_all_hooks: if apps define hooks for other apps last app wins: seen with/for perp_ar; now all available hooks are collected first and then registered with register_hooks (loop per app) --- phpgwapi/inc/class.hooks.inc.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/phpgwapi/inc/class.hooks.inc.php b/phpgwapi/inc/class.hooks.inc.php index 245314d9c8..a1cefdf673 100644 --- a/phpgwapi/inc/class.hooks.inc.php +++ b/phpgwapi/inc/class.hooks.inc.php @@ -253,6 +253,20 @@ class hooks if(@file_exists($f)) include($f); // some apps have setup_info for more then themselfs (eg. phpgwapi for groupdav) foreach($setup_info as $appname => $data) + { + if ($data['hooks']) + { + if ($hdata[$appname]) + { + $hdata[$appname]['hooks'] = array_merge($hdata[$appname]['hooks'],$data['hooks']); + } + else + { + $hdata[$appname]['hooks'] = $data['hooks']; + } + } + } + foreach((array)$hdata as $appname => $data) { if ($data['hooks']) $this->register_hooks($appname,$data['hooks']); }