APIv4 - Fix resolving pseudoconstants for less-permissioned users
[civicrm-core.git] / Civi / Api4 / Utils / FormattingUtil.php
index da1129ad4fa606350e9c0c14d836729cc9f607ec..efacccb3de3ee905d0d262f04dced2e3d89a188c 100644 (file)
@@ -265,7 +265,7 @@ class FormattingUtil {
     }
     // 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)) {