From 38b95e0f52178150ca6ce5f605e85b720bf28093 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Mon, 3 Nov 2014 16:26:21 +0530 Subject: [PATCH] CRM-15556 fix - Checkbox custom field error of OnBehalf profile on online contribution's confirm page https://issues.civicrm.org/jira/browse/CRM-15556 --- CRM/Contribute/Form/Contribution/Confirm.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/Form/Contribution/Confirm.php b/CRM/Contribute/Form/Contribution/Confirm.php index 36365b1545..6191c4ebd1 100644 --- a/CRM/Contribute/Form/Contribution/Confirm.php +++ b/CRM/Contribute/Form/Contribution/Confirm.php @@ -586,7 +586,14 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr // Recursively set defaults for nested fields if (isset($contact[$name]) && is_array($contact[$name]) && ($name == 'onbehalf' || $name == 'honor')) { foreach ($contact[$name] as $fieldName => $fieldValue) { - $defaults["{$name}[{$fieldName}]"] = $fieldValue; + if (is_array($fieldValue)) { + foreach ($fieldValue as $key => $value) { + $defaults["{$name}[{$fieldName}][{$key}]"] = $value; + } + } + else { + $defaults["{$name}[{$fieldName}]"] = $fieldValue; + } } } elseif (isset($contact[$name])) { -- 2.25.1