From 8f59debe909896ae0cce8fd31914b30820318ced Mon Sep 17 00:00:00 2001 From: Michael McAndrew Date: Wed, 20 Dec 2023 15:58:03 +0100 Subject: [PATCH] Some minor readability improvements --- ext/search_kit/Civi/Search/Admin.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ext/search_kit/Civi/Search/Admin.php b/ext/search_kit/Civi/Search/Admin.php index ccad5f42ac..ea19b652b4 100644 --- a/ext/search_kit/Civi/Search/Admin.php +++ b/ext/search_kit/Civi/Search/Admin.php @@ -282,10 +282,10 @@ class Admin { public static function getJoins(array $allowedEntities):array { $joins = []; foreach ($allowedEntities as $entity) { - $isCustomEntity = in_array('CustomValue', $entity['type'], TRUE); + $isMultiValueCustomEntity = in_array('CustomValue', $entity['type'], TRUE); - // Non-custom DAO entities - if (!$isCustomEntity && !empty($entity['dao'])) { + // Normal DAO entities (excludes multi-value custom field entities) + if (!empty($entity['dao']) && !$isMultiValueCustomEntity) { /** @var \CRM_Core_DAO $daoClass */ $daoClass = $entity['dao']; $references = $daoClass::getReferenceColumns(); @@ -401,7 +401,7 @@ class Admin { // Custom EntityRef joins foreach ($entity['fields'] as $field) { - if (($field['type'] === 'Custom' || $isCustomEntity) && $field['fk_entity'] && $field['input_type'] === 'EntityRef') { + if (($field['type'] === 'Custom' || $isMultiValueCustomEntity) && $field['fk_entity'] && $field['input_type'] === 'EntityRef') { $entityRefJoins = self::getEntityRefJoins($entity, $field); foreach ($entityRefJoins as $joinEntity => $joinInfo) { $joins[$joinEntity][] = $joinInfo; @@ -413,7 +413,8 @@ class Admin { } /** - * Get joins for entity reference custom fields, and the entity_id fields in multi-record custom groups. + * Get joins for entity reference custom fields, and the entity_id field in + * multi-record custom groups. * * @return array[] */ -- 2.25.1