1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

When a non-broadcasting revision is updated, put it in "Draft", not "Needs Review"

Summary: Depends on D19285. Ref T13110. When you update an "Abandoned + But, Never Promoted" revision or (in the future) a "Changes Planned + But, Never Promoted" revision, return it to the "Draft" state rather than promoting it.

Test Plan: Updated an "Abandoned + Draft" revision, saw it return to "Draft".

Maniphest Tasks: T13110

Differential Revision: https://secure.phabricator.com/D19286
This commit is contained in:
epriestley 2018-04-03 08:54:54 -07:00
parent 615d27c8e9
commit d9bd36039f

View file

@ -13,8 +13,14 @@ final class DifferentialRevisionUpdateTransaction
public function applyInternalEffects($object, $value) {
$should_review = $this->shouldRequestReviewAfterUpdate($object);
if ($should_review) {
$object->setModernRevisionStatus(
DifferentialRevisionStatus::NEEDS_REVIEW);
// If we're updating a non-broadcasting revision, put it back in draft
// rather than moving it directly to "Needs Review".
if ($object->getShouldBroadcast()) {
$new_status = DifferentialRevisionStatus::NEEDS_REVIEW;
} else {
$new_status = DifferentialRevisionStatus::DRAFT;
}
$object->setModernRevisionStatus($new_status);
}
$editor = $this->getEditor();