X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FMenu.php;h=bd9900df2f984e7b47e71854520c3e39f6d156f4;hb=57b4337624bde981c699a4bf132d7a9ccb7c6826;hp=79e4f552f3d9fe6e6a6625c4819972e3aabb9ece;hpb=395c6874c8aea03b2d8e3268e15a42c29ac64ac7;p=civicrm-core.git diff --git a/CRM/Core/Menu.php b/CRM/Core/Menu.php index 79e4f552f3..bd9900df2f 100644 --- a/CRM/Core/Menu.php +++ b/CRM/Core/Menu.php @@ -105,13 +105,15 @@ class CRM_Core_Menu { * An XML document defining a list of menu items. * @param array $menu * An alterable list of menu items. + * + * @throws CRM_Core_Exception */ public static function readXML($xml, &$menu) { $config = CRM_Core_Config::singleton(); foreach ($xml->item as $item) { if (!(string ) $item->path) { CRM_Core_Error::debug('i', $item); - CRM_Core_Error::fatal(); + throw new CRM_Core_Exception('Unable to read XML file'); } $path = (string ) $item->path; $menu[$path] = array(); @@ -204,7 +206,7 @@ class CRM_Core_Menu { * @param array $menu * @param string $path * - * @throws Exception + * @throws CRM_Core_Exception */ public static function fillMenuValues(&$menu, $path) { $fieldsToPropagate = array( @@ -240,15 +242,15 @@ class CRM_Core_Menu { return; } - $messages = array(); + $messages = []; foreach ($fieldsToPropagate as $field) { if (!$fieldsPresent[$field]) { $messages[] = ts("Could not find %1 in path tree", - array(1 => $field) + [1 => $field] ); } } - CRM_Core_Error::fatal("'$path': " . implode(', ', $messages)); + throw new CRM_Core_Exception("'$path': " . implode(', ', $messages)); } /**