SearchKit - Exclude serialized fields from implicit join selection
authorColeman Watts <coleman@civicrm.org>
Tue, 27 Apr 2021 03:00:23 +0000 (23:00 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 27 Apr 2021 03:00:23 +0000 (23:00 -0400)
ext/search_kit/Civi/Search/Admin.php

index ac5d8fa916784a958c55daf26330affaffed8a2f..b516429806ddc9b97296995bd451732ff082dead 100644 (file)
@@ -123,7 +123,7 @@ class Admin {
     foreach ($schema as &$entity) {
       if (in_array('DAOEntity', $entity['type'], TRUE) && !in_array('EntityBridge', $entity['type'], TRUE)) {
         foreach (array_reverse($entity['fields'], TRUE) as $index => $field) {
-          if (!empty($field['fk_entity']) && !$field['options'] && !empty($schema[$field['fk_entity']]['label_field'])) {
+          if (!empty($field['fk_entity']) && !$field['options'] && empty($field['serialize']) && !empty($schema[$field['fk_entity']]['label_field'])) {
             $isCustom = strpos($field['name'], '.');
             // Custom fields: append "Contact ID" to original field label
             if ($isCustom) {