Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-15182 - on behalf of: preloaded org is not preserved #4049

Merged
merged 2 commits into from
Sep 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CRM/Contribute/Form/Contribution/Confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,14 @@ public function preProcess() {
}
// if onbehalf-of-organization
if (!empty($this->_params['hidden_onbehalf_profile'])) {
if (!empty($this->_params['org_option']) && !empty($this->_params['organization_id'])) {
// CRM-15182
if (empty($this->_params['org_option']) && empty($this->_params['organization_id'])) {
if (!empty($this->_params['onbehalfof_id'])) {
$this->_params['organization_id'] = $this->_params['onbehalfof_id'];
}
else {
$this->_params['organization_id'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_params['onbehalf']['organization_name'], 'id', 'display_name');
}
}

$this->_params['organization_name'] = $this->_params['onbehalf']['organization_name'];
Expand Down Expand Up @@ -1529,7 +1533,7 @@ static function processOnBehalfOrganization(&$behalfOrganization, &$contactID, &
$isCurrentEmployer = FALSE;
$dupeIDs = array();
$orgID = NULL;
if (!empty($behalfOrganization['organization_id']) && !empty($behalfOrganization['org_option'])) {
if (!empty($behalfOrganization['organization_id']) && empty($behalfOrganization['org_option'])) {
$orgID = $behalfOrganization['organization_id'];
unset($behalfOrganization['organization_id']);
$isCurrentEmployer = TRUE;
Expand Down
4 changes: 3 additions & 1 deletion CRM/Contribute/Form/Contribution/OnBehalfOf.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ static function preProcess(&$form) {
$form->assign('locDataURL', $locDataURL);

if (!empty($form->_submitValues['onbehalf'])) {
$form->assign('submittedOnBehalf', $form->_submitValues['onbehalfof_id']);
if (!empty($form->_submitValues['onbehalfof_id'])) {
$form->assign('submittedOnBehalf', $form->_submitValues['onbehalfof_id']);
}
$form->assign('submittedOnBehalfInfo', json_encode($form->_submitValues['onbehalf']));
}
}
Expand Down