From: Coleman Watts Date: Thu, 6 Jan 2022 19:26:59 +0000 (-0500) Subject: APIv4 - Fix incorrect placement of decodeRows in loop X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=30493ced57146bf1f405b488e2fc150a898a1a5e;p=civicrm-core.git APIv4 - Fix incorrect placement of decodeRows in loop The funciton is designed to loop through all items, so needs to be placed outside the loop that creates the items. --- diff --git a/Civi/Api4/Generic/Traits/DAOActionTrait.php b/Civi/Api4/Generic/Traits/DAOActionTrait.php index 8f00ba7ee0..02a105a0ba 100644 --- a/Civi/Api4/Generic/Traits/DAOActionTrait.php +++ b/Civi/Api4/Generic/Traits/DAOActionTrait.php @@ -169,7 +169,6 @@ trait DAOActionTrait { } $result[] = $this->baoToArray($createResult, $item); - \CRM_Utils_API_HTMLInputCoder::singleton()->decodeRows($result); } // Use bulk `writeRecords` method if the BAO doesn't have a create or add method @@ -181,6 +180,7 @@ trait DAOActionTrait { } } + \CRM_Utils_API_HTMLInputCoder::singleton()->decodeRows($result); FormattingUtil::formatOutputValues($result, $this->entityFields()); return $result; }