From 995c1503e7ef7fa8ebe067dcddd3f1ad6b58172a Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 1 Jun 2017 07:58:10 -0700 Subject: [PATCH] Hide "X created Y, a subtask of P." feed stories again Summary: Fixes T12787. Modular Transactions don't actually support `shouldHideForFeed()`. I'll add some discussion to the task. Test Plan: Created a subtask, saw no more "X reopened Y, a subtask of P" feed story. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12787 Differential Revision: https://secure.phabricator.com/D18058 --- .../maniphest/storage/ManiphestTransaction.php | 16 ++++++++++++++++ .../xaction/ManiphestTaskUnblockTransaction.php | 9 --------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/applications/maniphest/storage/ManiphestTransaction.php b/src/applications/maniphest/storage/ManiphestTransaction.php index e2739c1d09..6301241050 100644 --- a/src/applications/maniphest/storage/ManiphestTransaction.php +++ b/src/applications/maniphest/storage/ManiphestTransaction.php @@ -40,6 +40,22 @@ final class ManiphestTransaction return parent::shouldGenerateOldValue(); } + public function shouldHideForFeed() { + // NOTE: Modular transactions don't currently support this, and it has + // very few callsites, and it's publish-time rather than display-time. + // This should probably become a supported, display-time behavior. For + // discussion, see T12787. + + // Hide "alice created X, a task blocking Y." from feed because it + // will almost always appear adjacent to "alice created Y". + $is_new = $this->getMetadataValue('blocker.new'); + if ($is_new) { + return true; + } + + return parent::shouldHideForFeed(); + } + public function getRequiredHandlePHIDs() { $phids = parent::getRequiredHandlePHIDs(); diff --git a/src/applications/maniphest/xaction/ManiphestTaskUnblockTransaction.php b/src/applications/maniphest/xaction/ManiphestTaskUnblockTransaction.php index 905554a3a3..1c7a88dec7 100644 --- a/src/applications/maniphest/xaction/ManiphestTaskUnblockTransaction.php +++ b/src/applications/maniphest/xaction/ManiphestTaskUnblockTransaction.php @@ -9,15 +9,6 @@ final class ManiphestTaskUnblockTransaction return null; } - public function shouldHideForFeed() { - // Hide "alice created X, a task blocking Y." from feed because it - // will almost always appear adjacent to "alice created Y". - $is_new = $this->getMetadataValue('blocker.new'); - if ($is_new) { - return true; - } - } - public function getActionName() { $old = $this->getOldValue(); $new = $this->getNewValue();