From d8987bb5ea55cd9977c7a318dd6832a287dc8e0d Mon Sep 17 00:00:00 2001 From: colemanw Date: Sun, 11 Feb 2024 18:02:57 -0500 Subject: [PATCH] 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 --- Civi/Api4/Utils/FormattingUtil.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.25.1