Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15429687
D19067.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D19067.diff
View Options
diff --git a/src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php b/src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php
--- a/src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php
+++ b/src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php
@@ -57,8 +57,19 @@
protected function validateAction($object, PhabricatorUser $viewer) {
if ($object->isDraft()) {
- throw new Exception(
- pht('You can not plan changes to a draft revision.'));
+
+ // See PHI346. Until the "Draft" state fully unprototypes, allow drafts
+ // to be moved to "changes planned" via the API. This preserves the
+ // behavior of "arc diff --plan-changes". We still prevent this
+ // transition from the web UI.
+ // TODO: Remove this once drafts leave prototype.
+
+ $editor = $this->getEditor();
+ $type_web = PhabricatorWebContentSource::SOURCECONST;
+ if ($editor->getContentSource()->getSource() == $type_web) {
+ throw new Exception(
+ pht('You can not plan changes to a draft revision.'));
+ }
}
if ($object->isChangePlanned()) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 25, 3:37 AM (3 d, 21 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7671943
Default Alt Text
D19067.diff (1 KB)
Attached To
Mode
D19067: Allow "arc diff --plan-changes" to work with drafts enabled
Attached
Detach File
Event Timeline
Log In to Comment