CRM-18559 - the value returned from validateSubTypeByEntity() does not include value...
authorDave Jenkins <davej+git@circle-interactive.co.uk>
Mon, 16 May 2016 16:53:32 +0000 (17:53 +0100)
committerDave Jenkins <davej+git@circle-interactive.co.uk>
Mon, 16 May 2016 16:53:32 +0000 (17:53 +0100)
CRM/Core/BAO/CustomGroup.php

index 9a4937e8128362c7dbf6c676168684833d4f75a6..90c7685addaf80fc997ded03ebd71a23c9f1aaf2 100644 (file)
@@ -433,7 +433,9 @@ LEFT JOIN civicrm_custom_field ON (civicrm_custom_field.custom_group_id = civicr
 
     if (!empty($subTypes)) {
       foreach ($subTypes as $key => $subType) {
-        $subTypeClauses[] = "civicrm_custom_group.extends_entity_column_value LIKE '%" . self::validateSubTypeByEntity($entityType, $subType) . "%'";
+        // CRM-18559: the value returned from validateSubTypeByEntity does not
+        // include value separators, so they need to be added for the query.
+        $subTypeClauses[] = "civicrm_custom_group.extends_entity_column_value LIKE '%" . CRM_Core_DAO::VALUE_SEPARATOR . self::validateSubTypeByEntity($entityType, $subType) . CRM_Core_DAO::VALUE_SEPARATOR . "%'";
       }
       $subTypeClause = '(' .  implode(' OR ', $subTypeClauses) . ')';
       if (!$onlySubType) {