X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fapi.php;h=c5cae1e27f2115ea8a7dd40d000268e6e36dcc78;hb=8b46b06a3fbd1c8c750e5c312e40b68a14880926;hp=cccad8b01740dcb399a87030c4b5f98b80c9f7f9;hpb=c5f0aba40c34f663d47987c47404c7124bfba5b9;p=civicrm-core.git diff --git a/api/api.php b/api/api.php index cccad8b017..c5cae1e27f 100644 --- a/api/api.php +++ b/api/api.php @@ -63,7 +63,7 @@ function civicrm_api4(string $entity, string $action, array $params = [], $index $removeIndexField = FALSE; // If index field is not part of the select query, we add it here and remove it below - if ($indexField && !empty($params['select']) && is_array($params['select']) && !in_array($indexField, $params['select'])) { + if ($indexField && !empty($params['select']) && is_array($params['select']) && !\Civi\Api4\Utils\SelectUtil::isFieldSelected($indexField, $params['select'])) { $params['select'][] = $indexField; $removeIndexField = TRUE; }