From 489257ba265aaa6f45c61d69babb4b280b820e8e Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 18 May 2022 20:01:52 -0400 Subject: [PATCH] APIv4 GetFields - Ignore invalid fields rather than fatal error in getFields action --- Civi/Api4/Generic/DAOGetFieldsAction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Civi/Api4/Generic/DAOGetFieldsAction.php b/Civi/Api4/Generic/DAOGetFieldsAction.php index e877e6dd8b..77a97e82ec 100644 --- a/Civi/Api4/Generic/DAOGetFieldsAction.php +++ b/Civi/Api4/Generic/DAOGetFieldsAction.php @@ -111,7 +111,7 @@ class DAOGetFieldsAction extends BasicGetFieldsAction { throw new \API_Exception('Illegal expression'); } $baoName = CoreUtil::getBAOFromApiName($this->getEntityName()); - $options = $baoName::buildOptions($fieldName, $context); + $options = $baoName::buildOptions($fieldName, $context) ?: []; $this->values[$fieldName] = FormattingUtil::replacePseudoconstant($options, $this->values[$key], TRUE); unset($this->values[$key]); } -- 2.25.1