From d184a61218840093f9e4f69cb53e234414b8e6fb Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Thu, 29 Jan 2015 14:54:18 -0800 Subject: [PATCH] Projects - stop automagically associating projects when they are mentioned Summary: Fixes T6819. This isn't as useful as you might think and has one horribly buggy behavior - if you edit an object which has a description and a projects field, you can be unable to remove the associated project as the automagic association from the description kicks in. Further, since we've added the ability for applications to create multiple email addresses AND herald can react to those emails - say by programmatically adding projects - the known needs for this feature are basically 0. If this proves to be false we can maybe add some other syntax for these mentions - see T6819 for ideas / discussion. Test Plan: removed a project from a maniphest task while still mentioning it in the description and it worked! Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6819 Differential Revision: https://secure.phabricator.com/D11573 --- ...habricatorApplicationTransactionEditor.php | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php index c8154dff7c..b80c75e3e2 100644 --- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php +++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php @@ -1242,25 +1242,6 @@ abstract class PhabricatorApplicationTransactionEditor return $block_xactions; } - if ($object instanceof PhabricatorProjectInterface) { - $phids = $mentioned_phids; - $project_type = PhabricatorProjectProjectPHIDType::TYPECONST; - foreach ($phids as $key => $phid) { - if (phid_get_type($phid) != $project_type) { - unset($phids[$key]); - } - } - - if ($phids) { - $edge_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST; - $block_xactions[] = newv(get_class(head($xactions)), array()) - ->setIgnoreOnNoEffect(true) - ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) - ->setMetadataValue('edge:type', $edge_type) - ->setNewValue(array('+' => $phids)); - } - } - $mentioned_objects = id(new PhabricatorObjectQuery()) ->setViewer($this->getActor()) ->withPHIDs($mentioned_phids)