From: colemanw Date: Sun, 11 Feb 2024 23:02:57 +0000 (-0500) Subject: APIv4 - Fetch all options when matching pseudoconstants. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d8987bb5ea55cd9977c7a318dd6832a287dc8e0d;p=civicrm-core.git APIv4 - Fetch all options when matching pseudoconstants. When performing a match we want to fetch all options not a filtered list. Fixes https://lab.civicrm.org/dev/core/-/issues/4997 --- diff --git a/Civi/Api4/Utils/FormattingUtil.php b/Civi/Api4/Utils/FormattingUtil.php index 2aba6212f2..f48acaab4e 100644 --- a/Civi/Api4/Utils/FormattingUtil.php +++ b/Civi/Api4/Utils/FormattingUtil.php @@ -303,7 +303,9 @@ class FormattingUtil { // Use BAO::buildOptions if possible if ($baoName) { $fieldName = empty($field['custom_field_id']) ? $field['name'] : 'custom_' . $field['custom_field_id']; - $options = $baoName::buildOptions($fieldName, $context, self::filterByPath($values, $fieldPath, $field['name'])); + $entityValues = self::filterByPath($values, $fieldPath, $field['name']); + $entityValues['check_permissions'] = FALSE; + $options = $baoName::buildOptions($fieldName, $context, $entityValues); } // Fallback for option lists that exist in the api but not the BAO if (!isset($options) || $options === FALSE) {