CRM-15556 fix - Checkbox custom field error of OnBehalf profile on online contributio...
authormonishdeb <monish.deb@webaccessglobal.com>
Mon, 3 Nov 2014 10:56:21 +0000 (16:26 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Mon, 3 Nov 2014 10:56:21 +0000 (16:26 +0530)
https://issues.civicrm.org/jira/browse/CRM-15556

CRM/Contribute/Form/Contribution/Confirm.php

index 36365b1545c2c8f1cd381e1044ba4833eb579b24..6191c4ebd1ba91c6f04ef5342e73d78f8c399e89 100644 (file)
@@ -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])) {