Skip loop iteration if 'element_name' field is not set
authorBorislav Zlatanov <borislav_zlatanov@yahoo.co.uk>
Tue, 18 Aug 2015 20:53:13 +0000 (23:53 +0300)
committerBorislav Zlatanov <borislav_zlatanov@yahoo.co.uk>
Tue, 18 Aug 2015 20:53:13 +0000 (23:53 +0300)
CRM/Core/BAO/CustomGroup.php

index bfdbb58dbf84e2c538696b41d7ba6ba70e8c93fa..4e1fc6a74e240613af61ff4133444d59f196e291 100644 (file)
@@ -1297,9 +1297,12 @@ ORDER BY civicrm_custom_group.weight,
           continue;
         }
 
-        if (!empty($field['element_name'])) {
-          $elementName = $field['element_name'];
+        if (empty($field['element_name'])) {
+          continue;
         }
+        
+        $elementName = $field['element_name'];
+        
         switch ($field['html_type']) {
           case 'Multi-Select':
           case 'AdvMulti-Select':