From: atif-shaikh Date: Fri, 9 Jan 2015 08:27:26 +0000 (+0530) Subject: CRM-15787 - QA Fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d9316a8e7b950b0d7f7eff7248d1bd234a8e2f16;p=civicrm-core.git CRM-15787 - QA Fix ---------------------------------------- * CRM-15787: Not possible to add contribution field in profile for on behalf membership https://issues.civicrm.org/jira/browse/CRM-15787 --- diff --git a/CRM/Contribute/Form/ContributionPage/Settings.php b/CRM/Contribute/Form/ContributionPage/Settings.php index 8a8fa5f8f0..b20f5f2f5f 100644 --- a/CRM/Contribute/Form/ContributionPage/Settings.php +++ b/CRM/Contribute/Form/ContributionPage/Settings.php @@ -146,7 +146,7 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_ //CRM-15787 - If applicable, register 'membership_1' $member = CRM_Member_BAO_Membership::getMembershipBlock($this->_id); - $allowMemberCoreTypes = ''; + $coreTypes = array('Contact', 'Organization'); $entities[] = array( 'entity_name' => array ('contact_1'), @@ -154,13 +154,13 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_ ); if ($member && $member['is_active']) { - $allowMemberCoreTypes = 'Membership'; + $coreTypes[] = 'Membership'; $entities[] = array( 'entity_name' => array ('membership_1'), 'entity_type' => 'MembershipModel', ); } - $allowCoreTypes = array_merge(array('Contact', 'Organization', $allowMemberCoreTypes), CRM_Contact_BAO_ContactType::subTypes('Organization')); + $allowCoreTypes = array_merge($coreTypes, CRM_Contact_BAO_ContactType::subTypes('Organization')); $allowSubTypes = array(); $this->addProfileSelector('onbehalf_profile_id', ts('Organization Profile'), $allowCoreTypes, $allowSubTypes, $entities);