CRM-12728-fix : fixed notices
authorPratik Joshi <pratik.joshi@webaccess.co.in>
Thu, 30 May 2013 14:38:27 +0000 (20:08 +0530)
committerPratik Joshi <pratik.joshi@webaccess.co.in>
Thu, 30 May 2013 14:38:27 +0000 (20:08 +0530)
CRM/Core/BAO/Navigation.php

index a17438d5e55135dd66d812c7cb6b4ec39b7b8f11..983c93fb4db86c579d33691d74611e4bb07e50fe 100644 (file)
@@ -99,14 +99,14 @@ class CRM_Core_BAO_Navigation extends CRM_Core_DAO_Navigation {
       if ($navName = CRM_Utils_Array::value('name', $params)) {
         $params['name'] = $navName;
       }
-      else {
-        $params['name'] = $params['label'];
+      elseif ($navLabel = CRM_Utils_Array::value('label', $params)) {
+        $params['name'] = $navLabel;
       }
 
       $params['weight'] = self::calculateWeight(CRM_Utils_Array::value('parent_id', $params));
     }
 
-    if (is_array($params['permission'])) {
+    if (array_key_exists('permission', $params) && is_array($params['permission'])) {
       $params['permission'] = implode(',', $params['permission']);
     }