Page MenuHomePhorge

D25338.1726912154.diff
No OneTemporary

D25338.1726912154.diff

diff --git a/src/applications/differential/editor/DifferentialRevisionEditEngine.php b/src/applications/differential/editor/DifferentialRevisionEditEngine.php
--- a/src/applications/differential/editor/DifferentialRevisionEditEngine.php
+++ b/src/applications/differential/editor/DifferentialRevisionEditEngine.php
@@ -189,7 +189,7 @@
// Don't show the "Author" field when creating a revision using the web
// workflow, since it adds more noise than signal to this workflow.
- if ($this->getIsCreate()) {
+ if ($is_create) {
$author_field->setIsHidden(true);
}
@@ -239,6 +239,12 @@
->setConduitTypeDescription(pht('New reviewers.'))
->setValue($object->getReviewerPHIDsForEdit());
+ // Prefill Repository for example when coming from "Attach To".
+ $repository_phid = $object->getRepositoryPHID();
+ if ($is_create && !$repository_phid && $diff) {
+ $repository_phid = $diff->getRepositoryPHID();
+ }
+
$fields[] = id(new PhabricatorDatasourceEditField())
->setKey('repositoryPHID')
->setLabel(pht('Repository'))
@@ -248,7 +254,7 @@
->setDescription(pht('The repository the revision belongs to.'))
->setConduitDescription(pht('Change the repository for this revision.'))
->setConduitTypeDescription(pht('New repository.'))
- ->setSingleValue($object->getRepositoryPHID());
+ ->setSingleValue($repository_phid);
// This is a little flimsy, but allows "Maniphest Tasks: ..." to continue
// working properly in commit messages until we fully sort out T5873.

File Metadata

Mime Type
text/plain
Expires
Sat, Sep 21, 09:49 (20 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
893750
Default Alt Text
D25338.1726912154.diff (1 KB)

Event Timeline