From 537d91888ad87cb432a075e89e3307ae279a363e Mon Sep 17 00:00:00 2001 From: Eileen Date: Fri, 22 Apr 2016 09:01:41 +0000 Subject: [PATCH] CRM-5507 CRM-17984 fix regression when subType var is not leaking --- CRM/Core/BAO/CustomGroup.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index a5720cf840..fe42c04bf8 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -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; } -- 2.25.1