From 6d0b4f67dcc4b85870b71f8f8f0eef434ada54be Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 15 Feb 2022 11:45:30 -0500 Subject: [PATCH] APIv4 - Don't check permissions for internal getOptions call --- Civi/Api4/Utils/FormattingUtil.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Civi/Api4/Utils/FormattingUtil.php b/Civi/Api4/Utils/FormattingUtil.php index 140e14924439..f0ef3b1be191 100644 --- a/Civi/Api4/Utils/FormattingUtil.php +++ b/Civi/Api4/Utils/FormattingUtil.php @@ -265,7 +265,12 @@ public static function getPseudoconstantList(array $field, string $fieldAlias, $ } // Fallback for option lists that exist in the api but not the BAO if (!isset($options) || $options === FALSE) { - $options = civicrm_api4($field['entity'], 'getFields', ['action' => $action, 'loadOptions' => ['id', $valueType], 'where' => [['name', '=', $field['name']]]])[0]['options'] ?? NULL; + $options = civicrm_api4($field['entity'], 'getFields', [ + 'checkPermissions' => FALSE, + 'action' => $action, + 'loadOptions' => ['id', $valueType], + 'where' => [['name', '=', $field['name']]], + ])[0]['options'] ?? NULL; $options = $options ? array_column($options, $valueType, 'id') : $options; } if (is_array($options)) {