CRM-16551 Notice on demo site re custom fields
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 25 May 2015 12:49:09 +0000 (18:19 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 25 May 2015 12:49:09 +0000 (18:19 +0530)
CRM/Custom/Page/Group.php

index 88787d75fae99f373ec2518e584e9668febe96c3..6c13b7ebf0fd2b8e375266f126c2b4955195b114 100644 (file)
@@ -206,9 +206,12 @@ class CRM_Custom_Page_Group extends CRM_Core_Page {
     $dao->orderBy('weight, title');
     $dao->find();
 
+    $customGroupExtends = CRM_Core_SelectValues::customGroupExtends();
+    $customGroupStyle = CRM_Core_SelectValues::customGroupStyle();
     while ($dao->fetch()) {
-      $customGroup[$dao->id] = array();
-      CRM_Core_DAO::storeValues($dao, $customGroup[$dao->id]);
+      $id = $dao->id;
+      $customGroup[$id] = array();
+      CRM_Core_DAO::storeValues($dao, $customGroup[$id]);
       // form all action links
       $action = array_sum(array_keys($this->actionLinks()));
 
@@ -219,22 +222,19 @@ class CRM_Custom_Page_Group extends CRM_Core_Page {
       else {
         $action -= CRM_Core_Action::DISABLE;
       }
-      $customGroup[$dao->id]['order'] = $customGroup[$dao->id]['weight'];
-      $customGroup[$dao->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action,
-        array('id' => $dao->id),
+      $customGroup[$id]['order'] = $customGroup[$id]['weight'];
+      $customGroup[$id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action,
+        array('id' => $id),
         ts('more'),
         FALSE,
         'customGroup.row.actions',
         'CustomGroup',
-        $dao->id
+        $id
       );
-    }
-
-    $customGroupExtends = CRM_Core_SelectValues::customGroupExtends();
-    $customGroupStyle = CRM_Core_SelectValues::customGroupStyle();
-    foreach ($customGroup as $key => $array) {
-      $customGroup[$key]['style_display'] = $customGroupStyle[$customGroup[$key]['style']];
-      $customGroup[$key]['extends_display'] = $customGroupExtends[$customGroup[$key]['extends']];
+      if (!empty($customGroup[$id]['style'])) {
+        $customGroup[$id]['style_display'] = $customGroupStyle[$customGroup[$id]['style']];
+      }
+      $customGroup[$id]['extends_display'] = $customGroupExtends[$customGroup[$id]['extends']];
     }
 
     //fix for Displaying subTypes