From: Michael McAndrew Date: Wed, 20 Dec 2023 14:58:03 +0000 (+0100) Subject: Some minor readability improvements X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8f59debe909896ae0cce8fd31914b30820318ced;p=civicrm-core.git Some minor readability improvements --- 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[] */