From: Pradeep Nayak Date: Sun, 5 Apr 2020 21:42:14 +0000 (+0100) Subject: Fix multiselect/checkbox custom field defaults on contribution online form X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b166697733acb7b6f5171a685d17426cb6522847;p=civicrm-core.git Fix multiselect/checkbox custom field defaults on contribution online form --- diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 2c9a0cca8f..458b52cf5e 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -93,7 +93,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu $contribFields = CRM_Contribute_BAO_Contribution::getContributionFields(); // remove component related fields - foreach ($this->_fields as $name => $dontCare) { + foreach ($this->_fields as $name => $fieldInfo) { //don't set custom data Used for Contribution (CRM-1344) if (substr($name, 0, 7) == 'custom_') { $id = substr($name, 7); @@ -105,7 +105,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu elseif (array_key_exists($name, $contribFields) || (substr($name, 0, 11) == 'membership_') || (substr($name, 0, 13) == 'contribution_')) { continue; } - $fields[$name] = 1; + $fields[$name] = $fieldInfo; } if (!empty($fields)) {