jenkins-bot has submitted this change and it was merged.

Change subject: Further fix on address merging to support form override
......................................................................


Further fix on address merging to support form override

Bypass hook on form-merge

I tested this againt batch merges by logged in user steps below and confirmed 
those activate the batch path

- create 2 contacts called qw...@wert.com first name & last name = qwert
- one contact has a contribution from today and an address that says 'today'
- other was 'last year' in both contribution & address
- Find & merge duplicate contacts - using a smart group (I created of 'qwerts').
- check the box & do a batch merge of selected contacts
- I tried this with both the lower id having the more recent contact & vice 
versa

Bug: T144440
Change-Id: I3608f16bc0d21c02408b5774f7db00e094c64f1d
---
M sites/all/modules/wmf_civicrm/wmf_civicrm.module
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Eileen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sites/all/modules/wmf_civicrm/wmf_civicrm.module 
b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
index 41825e1..21d09d9 100644
--- a/sites/all/modules/wmf_civicrm/wmf_civicrm.module
+++ b/sites/all/modules/wmf_civicrm/wmf_civicrm.module
@@ -2071,6 +2071,7 @@
       case 'batch' :
       case 'form' :
 
+        $refs['migration_info']['context'] = $type;
         CRM_Core_DAO::executeQuery('SET @uniqueID = %1', array(1 => 
array(uniqid() . CRM_Utils_String::createRandom(CRM_Utils_String::ALPHANUMERIC, 
4), 'String')));
         if (isset($refs['fields_in_conflict'])){
           $wmfCalculatedFields = wmf_civicrm_get_calculated_fields();
@@ -2263,6 +2264,10 @@
  */
 function wmf_civicrm_civicrm_alterLocationMergeData(&$blocksDAO, $mainId, 
$otherId, $migrationInfo) {
 
+  // If we are dealing with a manual merge do not intervene.
+  if ($migrationInfo['context'] == 'form') {
+    return;
+  }
   $lastDonor = civicrm_api3('Contribution', 'get', array(
     'return' => 'contact_id',
     'contact_id' => array('IN' => array($mainId, $otherId)),

-- 
To view, visit https://gerrit.wikimedia.org/r/311646
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3608f16bc0d21c02408b5774f7db00e094c64f1d
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: deployment
Gerrit-Owner: Eileen <emcnaugh...@wikimedia.org>
Gerrit-Reviewer: Eileen <emcnaugh...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to