From dc4d7f1f3e8dfc2d25cded48ce821b6b84f63ec8 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 14 Jan 2019 14:32:01 -0800 Subject: [PATCH] Reorder "Merge" transaction to make "Close as Duplicate" produce a "[Merged]" email subject Summary: Fixes T11782. When you "Close as Duplicate", generate a "[Merged]" email by making the merge the first transaction. (There are other, more-deterministic ways to do this with action strength, but this is much simpler and I believe it suffices.) Test Plan: Used "Close as Duplicate", got a "[Merged]" email out of it. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T11782 Differential Revision: https://secure.phabricator.com/D19972 --- .../maniphest/relationship/ManiphestTaskRelationship.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/applications/maniphest/relationship/ManiphestTaskRelationship.php b/src/applications/maniphest/relationship/ManiphestTaskRelationship.php index 04f78b8523..a7d3e6f11c 100644 --- a/src/applications/maniphest/relationship/ManiphestTaskRelationship.php +++ b/src/applications/maniphest/relationship/ManiphestTaskRelationship.php @@ -31,13 +31,12 @@ abstract class ManiphestTaskRelationship $subscriber_phids = $this->loadMergeSubscriberPHIDs($tasks); $xactions[] = id(new ManiphestTransaction()) - ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS) - ->setNewValue(array('+' => $subscriber_phids)); + ->setTransactionType(ManiphestTaskMergedFromTransaction::TRANSACTIONTYPE) + ->setNewValue(mpull($tasks, 'getPHID')); $xactions[] = id(new ManiphestTransaction()) - ->setTransactionType( - ManiphestTaskMergedFromTransaction::TRANSACTIONTYPE) - ->setNewValue(mpull($tasks, 'getPHID')); + ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS) + ->setNewValue(array('+' => $subscriber_phids)); return $xactions; }