X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fapi.php;h=9ed9747dd0ca0b672fac76462c2f0f9ab911e6b2;hb=982d472ad903315d06eb02cfba6841bf553799bd;hp=795d3c0a341b99190b3338fe4d58770cf1f13e3c;hpb=33ce2de7697083327dd0e0bb553cafe7a5e78176;p=civicrm-core.git diff --git a/api/api.php b/api/api.php index 795d3c0a34..9ed9747dd0 100644 --- a/api/api.php +++ b/api/api.php @@ -16,7 +16,7 @@ * @param array $params * array to be passed to function * - * @return array|int + * @return array|int|Civi\Api4\Generic\Result */ function civicrm_api(string $entity, string $action, array $params) { return \Civi::service('civi_api_kernel')->runSafe($entity, $action, $params); @@ -64,7 +64,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 (except for oddball "Setting" api) - if ($indexField && !empty($params['select']) && is_array($params['select']) && $entity !== 'Setting' && !\Civi\Api4\Utils\SelectUtil::isFieldSelected($indexField, $params['select'])) { + if ($indexField && !empty($params['select']) && is_array($params['select']) && !($entity === 'Setting' && $action === 'get') && !\Civi\Api4\Utils\SelectUtil::isFieldSelected($indexField, $params['select'])) { $params['select'][] = $indexField; $removeIndexField = TRUE; }