CRM-5507 CRM-17984 fix regression when subType var is not leaking
authorEileen <eileen@fuzion.co.nz>
Fri, 22 Apr 2016 09:01:41 +0000 (09:01 +0000)
committerEileen <eileen@fuzion.co.nz>
Fri, 22 Apr 2016 09:01:41 +0000 (09:01 +0000)
CRM/Core/BAO/CustomGroup.php

index a5720cf84079a209888760554efbdce253eec2a9..fe42c04bf88ec5f1300b9732e82c16697744c71a 100644 (file)
@@ -542,8 +542,10 @@ ORDER BY civicrm_custom_group.weight,
               continue;
             }
             // CRM-5507
-            if ($fieldName == 'extends_entity_column_value' && $subType) {
-              $groupTree[$groupID]['subtype'] = trim($subType, CRM_Core_DAO::VALUE_SEPARATOR);
+            // This is an old bit of code - per the CRM number & probably does not work reliably if
+            // that one contact sub-type exists.
+            if ($fieldName == 'extends_entity_column_value' && !empty($subTypes[0])) {
+              $groupTree[$groupID]['subtype'] = self::validateSubTypeByEntity($entityType, $subType);
             }
             $groupTree[$groupID][$fieldName] = $crmDAO->$fullFieldName;
           }