Skip to content
Snippets Groups Projects
Unverified Commit 08cf4821 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #23757 from colemanw/dupeFixAgain

Deduepe - Fix form buttons (again)
parents b70b865a afa4f120
No related branches found
No related tags found
No related merge requests found
......@@ -328,14 +328,13 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
CRM_Core_Session::setStatus($message, ts('Contacts Merged'), 'success');
$urlParams = ['reset' => 1, 'cid' => $this->_cid, 'rgid' => $this->_rgid, 'gid' => $this->_gid, 'limit' => $this->limit, 'criteria' => $this->criteria];
$contactViewUrl = CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'cid' => $this->_cid]);
// When clicking "Merge and go to listing"
if (!empty($formValues['_qf_Merge_submit'])) {
$urlParams['action'] = "update";
CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/contact/dedupefind',
$urlParams
));
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/dedupefind', $urlParams));
}
// When clicking "Merge and go to next pair"
elseif ($this->next && $this->_mergeId && empty($formValues['_qf_Merge_done'])) {
$cacheKey = CRM_Dedupe_Merger::getMergeCacheKeyString($this->_rgid, $this->_gid, json_decode($this->criteria, TRUE), TRUE, $this->limit);
......@@ -353,12 +352,15 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form {
$urlParams['oid'] = $pos['next']['id2'];
$urlParams['mergeId'] = $pos['next']['mergeId'];
$urlParams['action'] = 'update';
CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/contact/merge', $urlParams));
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/merge', $urlParams));
}
}
else {
CRM_Core_Session::singleton()->pushUserContext($contactViewUrl);
}
// When clicking "Merge and View Result" or when used from search forms
// Note: search might load this action in a popup, so cannot use a redirect.
$contactViewUrl = CRM_Utils_System::url('civicrm/contact/view', ['reset' => 1, 'cid' => $this->_cid]);
CRM_Core_Session::singleton()->pushUserContext($contactViewUrl);
// I think this bit is needed because this is a multi-step form.
$this->controller->setDestination($contactViewUrl);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment