CRM-19452 - remove common fields only if profile is not configured for onbehalf/honor
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 4 Oct 2016 11:55:44 +0000 (17:25 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 4 Oct 2016 11:55:44 +0000 (17:25 +0530)
CRM/Contribute/Form/ContributionBase.php

index 45f13c35ad34ed496e82b3552a4129454d92d1cd..7c6109f80a86d019543c582f9684aa05fa1252cb 100644 (file)
@@ -625,7 +625,10 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
           CRM_Core_Session::setStatus(ts('Some of the profile fields cannot be configured for this page.'), ts('Warning'), 'alert');
         }
 
-        $fields = array_diff_assoc($fields, $this->_fields);
+        //remove common fields only if profile is not configured for onbehalf/honor
+        if (!in_array($profileContactType, array('honor', 'onbehalf'))) {
+          $fields = array_diff_assoc($fields, $this->_fields);
+        }
 
         CRM_Core_BAO_Address::checkContactSharedAddressFields($fields, $contactID);
         $addCaptcha = FALSE;