APIv4 - Prevent fatal error when looking up pseudoconstant for field with no options
authorColeman Watts <coleman@civicrm.org>
Mon, 8 Aug 2022 21:57:30 +0000 (17:57 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 10 Aug 2022 02:28:44 +0000 (22:28 -0400)
Civi/Api4/Utils/FormattingUtil.php

index efacccb3de3ee905d0d262f04dced2e3d89a188c..2079d929fe4b2fcf9a9955a67cacc55f28d320d1 100644 (file)
@@ -211,7 +211,7 @@ class FormattingUtil {
         // Evaluate pseudoconstant suffixes
         $suffix = strrpos(($fieldName ?? ''), ':');
         $fieldOptions = NULL;
-        if ($suffix) {
+        if (isset($value) && $suffix) {
           $fieldOptions = self::getPseudoconstantList($field, $fieldName, $result, $action);
           $dataType = NULL;
         }