]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed a lot of notices being generated by the new plugin hook code
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 16 Dec 2010 14:14:52 +0000 (14:14 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 16 Dec 2010 14:14:52 +0000 (14:14 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7645 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/lib/elgglib.php

index cbb9fbdc9978f0c9ffb46c1196f763e22297ebb0..f4e4874263c3095abf5e4ccf8bf1b3ad985803a1 100644 (file)
@@ -1078,12 +1078,17 @@ function unregister_plugin_hook($hook, $entity_type, $callback) {
 function elgg_trigger_plugin_hook($hook, $type, $params = null, $returnvalue = null) {
        global $CONFIG;
 
-       $hooks = array(
-               $CONFIG->hooks[$hook][$type],
-               $CONFIG->hooks['all'][$type],
-               $CONFIG->hooks[$hook]['all'],
-               $CONFIG->hooks['all']['all'],
-       );
+       $hooks = array();
+       if (isset($CONFIG->hooks[$hook][$type])) {
+               $hooks[] = $CONFIG->hooks[$hook][$type];
+       }
+       if (isset($CONFIG->hooks['all'][$type])) {
+               $hooks[] = $CONFIG->hooks['all'][$type];
+       }
+       if (isset($CONFIG->hooks[$hook]['all'])) {
+               $hooks[] = $CONFIG->hooks[$hook]['all'];
+       }
+       $hooks[] = $CONFIG->hooks['all']['all'];
 
        foreach ($hooks as $callback_list) {
                if (is_array($callback_list)) {