From: Duck (Jakob Munih) Date: Wed, 30 Sep 2009 16:13:30 +0000 (+0200) Subject: Correctly catch errors X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d8bbce017ddfa990b8ce7abb916aef3376ba06e9;p=horde.git Correctly catch errors --- diff --git a/news/add.php b/news/add.php index 8c5fc354a..15ab9e541 100644 --- a/news/add.php +++ b/news/add.php @@ -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'];