From 30493ced57146bf1f405b488e2fc150a898a1a5e Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 6 Jan 2022 14:26:59 -0500 Subject: [PATCH] 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. --- Civi/Api4/Generic/Traits/DAOActionTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.25.1