From 2454bb63c3069cecff81686d9cfa57632e43a7e3 Mon Sep 17 00:00:00 2001 From: yashodha Date: Fri, 1 Apr 2016 18:56:03 +0530 Subject: [PATCH] CRM-17878: on behalf still seems to be loading on thankyou page ---------------------------------------- * CRM-17878: If 'on behalf of organisation' is set to 'optional' and then not chosen, it creates contact with no name and adds the relationship https://issues.civicrm.org/jira/browse/CRM-17878 --- CRM/Contribute/Form/Contribution/ThankYou.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/Form/Contribution/ThankYou.php b/CRM/Contribute/Form/Contribution/ThankYou.php index 528b6efd3b..753d41c774 100644 --- a/CRM/Contribute/Form/Contribution/ThankYou.php +++ b/CRM/Contribute/Form/Contribution/ThankYou.php @@ -186,7 +186,12 @@ class CRM_Contribute_Form_Contribution_ThankYou extends CRM_Contribute_Form_Cont $this->buildCustom($this->_values['custom_pre_id'], 'customPre', TRUE); $this->buildCustom($this->_values['custom_post_id'], 'customPost', TRUE); - if (!empty($params['onbehalf'])) { + if (!empty($this->_values['onbehalf_profile_id']) && + !empty($params['onbehalf']) && + ($this->_values['is_for_organization'] == 2 || + !empty($params['is_for_organization']) + ) + ) { $fieldTypes = array('Contact', 'Organization'); $contactSubType = CRM_Contact_BAO_ContactType::subTypes('Organization'); $fieldTypes = array_merge($fieldTypes, $contactSubType); -- 2.25.1