Correctly catch errors
authorDuck (Jakob Munih) <duck@obala.net>
Wed, 30 Sep 2009 16:13:30 +0000 (18:13 +0200)
committerDuck (Jakob Munih) <duck@obala.net>
Wed, 30 Sep 2009 16:13:30 +0000 (18:13 +0200)
news/add.php

index 8c5fc35..15ab9e5 100644 (file)
@@ -252,8 +252,12 @@ if (Horde_Auth::isAdmin('news:admin')) {
     }
 
     // Show from
-    $available = $GLOBALS['registry']->callByPackage('ulaform', 'getForms');
-    if (!($available instanceof PEAR_Error)) {
+    if ($registry->hasMethod('forms/getForms')) {
+        $available = $registry->call('forms/getForms');
+        if ($available instanceof PEAR_Error) {
+            $notification->push($available, 'horde.warning');
+            $available = array();
+        }
         $forms = array();
         foreach ($available as $f) {
             $forms[$f['form_id']] = $f['form_name'];