CRM-15938 e-notice fix
authorEileen McNaughton <eileen@fuzion.co.nz>
Sun, 8 Feb 2015 23:34:29 +0000 (12:34 +1300)
committerEileen McNaughton <eileen@fuzion.co.nz>
Sun, 8 Feb 2015 23:41:32 +0000 (12:41 +1300)
CRM/Report/Form/Instance.php

index 4a4431e88ab9442cdbd5368d0bf1c8e96bf1fdee..cc30f93ba2d643796fc85d0c8f2e212c03aad9f3 100644 (file)
@@ -241,7 +241,7 @@ class CRM_Report_Form_Instance {
       $defaults['report_footer'] = CRM_Utils_Array::value('footer', $defaults);
 
       if (!empty($defaults['navigation_id'])) {
-        //get the default navigation parent id
+        // Get the default navigation parent id.
         $params = array('id' => $defaults['navigation_id']);
         CRM_Core_BAO_Navigation::retrieve($params, $navigationDefaults);
         $defaults['is_navigation'] = 1;
@@ -253,7 +253,8 @@ class CRM_Report_Form_Instance {
 
         if (!empty($navigationDefaults['id'])) {
           $form->_navigation['id'] = $navigationDefaults['id'];
-          $form->_navigation['parent_id'] = $navigationDefaults['parent_id'];
+          $form->_navigation['parent_id'] = !empty($navigationDefaults['parent_id']) ?
+          $navigationDefaults['parent_id'] : NULL;
         }
       }