From 49570cb1c47895eb7831278cbf795e7da9b51fdb Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 8 Jun 2015 10:48:49 -0700 Subject: [PATCH] Fix an issue with mention transactions in Calendar Summary: Fixes an issue where mentioning an event name (like `E999`) in a revision summary (and probably elsewhere) would produce an error like this: ``` 2015/06/08 17:30:22 [error] 27702#0: *307450 FastCGI sent in stderr: "PHP message: [2015-06-08 17:30:22] EXCEPTION: (Exception) Transaction ("PHID-XACT-CEVT-zglgzy36aote5ja", of type "core:edge") requires a handle ("PHID-DREV-4m6vorimvg4bm3ltskca") that it did not load. at [/src/applications/transactions/storage/PhabricatorApplicationTransaction.php:285] PHP message: arcanist(head=master, ref.master=8c589f1f759f), phabricator(head=master, ref.master=b4de79741ceb), phutil(head=master, ref.master=4a0e1b47a584) PHP message: #0 <#2> PhabricatorApplicationTransaction::getHandle(string) called at [/src/applications/transactions/storage/PhabricatorApplicationTransaction.php:474] PHP message: #1 <#2> PhabricatorApplicationTransaction::shouldHide() called at [/src/applications/calendar/storage/PhabricatorCalendarEventTransaction.php:82] PHP message: #2 <#2> PhabricatorCalendarEventTransaction::shouldHide() called at [/src/utils/utils.php:428] PHP message: #3 <#2> mfilter(array, string, boolean) called at [/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php:350] PHP message: #4 <#2> PhabricatorCalendarEventEditor::shouldSendMail(PhabricatorCalendarEvent, array) called at [/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:990] PHP message: #5 <#2> PhabricatorApplicationTransactionEditor::applyTransactions(PhabricatorCalendarEvent, array) called at [/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:2937] PHP message: #6 <#2> PhabricatorApplicationTransactionEditor::applyInverseEdgeTransactions(DifferentialRevision, DifferentialTransaction, integer) called at [/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:602] ... ``` This is similar to rP98aae51c / rP0fc0af64, but for Calendar. (Likely, I copy/pasted the Editor from Maniphest a while ago.) We don't need to do this filtering here because we do it later before sending mail. Additionally, because some transactions may hide or show depending on the viewer, it's strictly incorrect to do it here. Test Plan: - Created a revision which mentioned a bunch of events. - Grepped for other implementations of `shouldSendMail()` and verified that none try to perform similar filtering. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley, lpriestley Differential Revision: https://secure.phabricator.com/D13210 --- .../calendar/editor/PhabricatorCalendarEventEditor.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php b/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php index 79b5946f04..d01946b370 100644 --- a/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php +++ b/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php @@ -370,9 +370,7 @@ final class PhabricatorCalendarEventEditor protected function shouldSendMail( PhabricatorLiskDAO $object, array $xactions) { - - $xactions = mfilter($xactions, 'shouldHide', true); - return $xactions; + return true; } protected function getMailSubjectPrefix() {