Fix callHook usage
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 10 Aug 2009 23:49:54 +0000 (19:49 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 10 Aug 2009 23:50:43 +0000 (19:50 -0400)
ansel/img/upload.php
ansel/lib/Api.php

index c975cdb..5ef5fff 100644 (file)
@@ -215,8 +215,6 @@ if ($form->validate($vars)) {
         // postupload hook if needed
         try {
             Horde::callHook('postupload', array($image_ids));
-        } catch (Horde_Exception $e) {
-            // Error from within the hook.
         } catch (Horde_Exception_HookNotSet $e) {}
         $notification->push(sprintf(ngettext("%d photo was uploaded.", "%d photos were uploaded.", $uploaded), $uploaded), 'horde.success');
     } elseif ($vars->get('submitbutton') != _("Cancel")) {
index 810846f..0a07cda 100644 (file)
@@ -638,7 +638,9 @@ class Ansel_Api extends Horde_Registry_Api
 
         // Call the postupload hook if needed
         if (!empty($GLOBALS['conf']['hooks']['postupload']) && !$skiphook) {
-            Horde::callHook('_ansel_hook_postupload', array(array($image_id)), 'ansel');
+            try {
+                Horde::callHook('postupload', array($image_id));
+            } catch (Horde_Exception_HookNotSet $e) {}
         }
 
         return array('image_id'   => (int)$image_id,