From a06618f879664afbe4154ac73d08a5d6204cd385 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 11 Jun 2015 05:53:29 -0700 Subject: [PATCH] Fix an issue where "Send an email to..." rules might be discarded Summary: Fixes T8464. We could lose the additional users from "Send an email..." rules //if// Herald did not apply any other transactions to the task. Test Plan: - Destroyed all Herald rules. - Created a single "Send an email to..." rule. - Created a task. - Saw target get an email. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T8464 Differential Revision: https://secure.phabricator.com/D13245 --- .../editor/PhabricatorApplicationTransactionEditor.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index 9602ee6227..b4d36b5513 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -936,14 +936,16 @@ abstract class PhabricatorApplicationTransactionEditor $object, $herald_xactions); - $adapter = $this->getHeraldAdapter(); - $this->heraldEmailPHIDs = $adapter->getEmailPHIDs(); - $this->heraldForcedEmailPHIDs = $adapter->getForcedEmailPHIDs(); - // Merge the new transactions into the transaction list: we want to // send email and publish feed stories about them, too. $xactions = array_merge($xactions, $herald_xactions); } + + // If Herald did not generate transactions, we may still need to handle + // "Send an Email" rules. + $adapter = $this->getHeraldAdapter(); + $this->heraldEmailPHIDs = $adapter->getEmailPHIDs(); + $this->heraldForcedEmailPHIDs = $adapter->getForcedEmailPHIDs(); } $this->didApplyTransactions($xactions);