From 1d1003af7854058ab78ea2018a4724c341353bb3 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 17 Mar 2021 12:15:09 -0700 Subject: [PATCH] When using "Update Diff" from the web UI, prefill "Repository" properly Summary: Ref T9499. When using the manual "Update Diff" workflow on the web, the "Repository" field isn't pre-filled properly. This can lead to revisions losing their repository after a manual update. Test Plan: Did a manual update of a revision with a repository, saw it stick. Maniphest Tasks: T9499 Differential Revision: https://secure.phabricator.com/D21638 --- .../controller/DifferentialDiffCreateController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/applications/differential/controller/DifferentialDiffCreateController.php b/src/applications/differential/controller/DifferentialDiffCreateController.php index 9aaf407e28..f9d1006555 100644 --- a/src/applications/differential/controller/DifferentialDiffCreateController.php +++ b/src/applications/differential/controller/DifferentialDiffCreateController.php @@ -27,7 +27,13 @@ final class DifferentialDiffCreateController extends DifferentialController { $diff = null; // This object is just for policy stuff $diff_object = DifferentialDiff::initializeNewDiff($viewer); - $repository_phid = null; + + if ($revision) { + $repository_phid = $revision->getRepositoryPHID(); + } else { + $repository_phid = null; + } + $errors = array(); $e_diff = null; $e_file = null;