@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Include "Draft" revisions in Differential legacy status queries

Summary:
See PHI199. Ref T2543. When you run a RevisionQuery with a legacy status constraint (via `differential.query`), we currently don't match "Draft" revisions.

Use the actual complete map from `DifferentialRevisionStatus` instead of hard coding the status list so "Draft" is included.

Test Plan:
- Ran `differential.query` with `ids` and `status` for a draft revision.
- Before patch: revision not returned in results.
- After patch: revision returned in results.

(Note that it returns as "Needs Review", for compatibility.)

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T2543

Differential Revision: https://secure.phabricator.com/D18765

+4 -8
+4 -8
src/applications/differential/constants/DifferentialLegacyQuery.php
··· 32 32 } 33 33 34 34 private static function getMap() { 35 - $all = array( 36 - DifferentialRevisionStatus::NEEDS_REVIEW, 37 - DifferentialRevisionStatus::NEEDS_REVISION, 38 - DifferentialRevisionStatus::CHANGES_PLANNED, 39 - DifferentialRevisionStatus::ACCEPTED, 40 - DifferentialRevisionStatus::PUBLISHED, 41 - DifferentialRevisionStatus::ABANDONED, 42 - ); 35 + $all = array_keys(DifferentialRevisionStatus::getAll()); 43 36 44 37 $open = array(); 45 38 $closed = array(); ··· 61 54 ), 62 55 self::STATUS_NEEDS_REVIEW => array( 63 56 DifferentialRevisionStatus::NEEDS_REVIEW, 57 + 58 + // For legacy callers, "Draft" is treated as "Needs Review". 59 + DifferentialRevisionStatus::DRAFT, 64 60 ), 65 61 self::STATUS_NEEDS_REVISION => array( 66 62 DifferentialRevisionStatus::NEEDS_REVISION,