Skip to content

Commit

Permalink
APIv4 - Don't check permissions for internal getOptions call
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Feb 15, 2022
1 parent 510b347 commit 6d0b4f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Civi/Api4/Utils/FormattingUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 6d0b4f6

Please sign in to comment.