From 37e81bb48ea67f73ea06c4eb75e0eab1d9fb710c Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 25 Mar 2022 09:20:52 -0400 Subject: [PATCH] Dedupe - Fix redirecting to contact after merge The final redirect was accidentally changed by a6f2a80ffbddfc0788199ec824b8aff46ccd1542 Fixes dev/core#3135 --- CRM/Contact/Form/Merge.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index b0857785a9..422806e64b 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -326,11 +326,7 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { $urlParams )); } - elseif (!empty($formValues['_qf_Merge_done'])) { - CRM_Core_Session::singleton()->pushUserContext($contactViewUrl); - } - - elseif ($this->next && $this->_mergeId) { + 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); $join = CRM_Dedupe_Merger::getJoinOnDedupeTable(); @@ -350,6 +346,9 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/contact/merge', $urlParams)); } } + else { + CRM_Core_Session::singleton()->pushUserContext($contactViewUrl); + } } /** -- 2.25.1