From 27785c4f759faa0ec6cfd8c04f195da4dae475ef Mon Sep 17 00:00:00 2001 From: vrana Date: Mon, 3 Dec 2012 16:19:17 -0800 Subject: [PATCH] Don't delete tasks attached by freeform fields in Maniphest Tasks field Summary: I didn't catch this issue at D3986 because we don't have `DifferentialManiphestTasksFieldSpecification` in field selector. Test Plan: Added `DifferentialManiphestTasksFieldSpecification` too field selector. Wrote `Refs T4` and not filled `T4` to Maniphest Tasks field. Reviewers: epriestley, 20after4 Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T945 Differential Revision: https://secure.phabricator.com/D4073 --- .../DifferentialManiphestTasksFieldSpecification.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php b/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php index fe04ceacf5..d628897632 100644 --- a/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php +++ b/src/applications/differential/field/specification/DifferentialManiphestTasksFieldSpecification.php @@ -3,6 +3,7 @@ final class DifferentialManiphestTasksFieldSpecification extends DifferentialFieldSpecification { + private $oldManiphestTasks = array(); private $maniphestTasks = array(); public function shouldAppearOnRevisionView() { @@ -51,9 +52,7 @@ final class DifferentialManiphestTasksFieldSpecification $revision_phid = $revision->getPHID(); $edge_type = PhabricatorEdgeConfig::TYPE_DREV_HAS_RELATED_TASK; - $old_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( - $revision_phid, - $edge_type); + $old_phids = $this->oldManiphestTasks; $add_phids = $this->maniphestTasks; $rem_phids = array_diff($old_phids, $add_phids); @@ -73,6 +72,7 @@ final class DifferentialManiphestTasksFieldSpecification protected function didSetRevision() { $this->maniphestTasks = $this->getManiphestTaskPHIDs(); + $this->oldManiphestTasks = $this->maniphestTasks; } public function getRequiredHandlePHIDsForCommitMessage() {