CRM-18338: Merge activity test fixes
authorJKingsnorth <john@johnkingsnorth.co.uk>
Fri, 22 Apr 2016 11:05:43 +0000 (12:05 +0100)
committerJKingsnorth <john@johnkingsnorth.co.uk>
Fri, 22 Apr 2016 11:09:11 +0000 (12:09 +0100)
CRM/Dedupe/Merger.php

index 0226c2d9fa986e3a48eb88eff7e49c2f4cd63bed..a983913124dc388598fb8e0436ec89481f2ff963 100644 (file)
@@ -1919,6 +1919,8 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
       2 => $mainId,
     );
     $activity = civicrm_api3('activity', 'create', array(
+      'source_contact_id' => CRM_Core_Session::getLoggedInContactID() ? CRM_Core_Session::getLoggedInContactID() :
+        $mainId,
       'subject' => ts('Contact ID %1 has been merged and deleted.', $params),
       'target_contact_id' => $mainId,
       'activity_type_id' => 'Contact Merged',
@@ -1926,6 +1928,8 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
     ));
     if (civicrm_api3('Setting', 'getvalue', array('name' => 'contact_undelete', 'group' => 'CiviCRM Preferences'))) {
       civicrm_api3('activity', 'create', array(
+        'source_contact_id' => CRM_Core_Session::getLoggedInContactID() ? CRM_Core_Session::getLoggedInContactID() :
+          $otherId,
         'subject' => ts('Contact ID %1 has been merged into Contact ID %2 and deleted.', $params),
         'target_contact_id' => $otherId,
         'activity_type_id' => 'Contact Deleted by Merge',