@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.

Give Phriction documents modern string status constants instead of numeric constants

Summary:
Depends on D19099. Ref T13077. Updates Phriction documents to string constants to make API interactions cleaner and statuses more practical to extend.

This does not seem to require any transaction migrations because none of the Phriction transactions actually store status values: status is always a side effect of other edits.

Test Plan: Created, edited, deleted, moved documents. Saw appropriate UI cues. Browsed and filtered documents by status in the index.

Maniphest Tasks: T13077

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

+19 -6
+2
resources/sql/autopatches/20180215.phriction.05.statustext.sql
··· 1 + ALTER TABLE {$NAMESPACE}_phriction.phriction_document 2 + CHANGE status status VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT};
+11
resources/sql/autopatches/20180215.phriction.06.statusvalue.sql
··· 1 + UPDATE {$NAMESPACE}_phriction.phriction_document 2 + SET status = 'active' WHERE status = '0'; 3 + 4 + UPDATE {$NAMESPACE}_phriction.phriction_document 5 + SET status = 'deleted' WHERE status = '1'; 6 + 7 + UPDATE {$NAMESPACE}_phriction.phriction_document 8 + SET status = 'moved' WHERE status = '2'; 9 + 10 + UPDATE {$NAMESPACE}_phriction.phriction_document 11 + SET status = 'stub' WHERE status = '3';
+4 -4
src/applications/phriction/constants/PhrictionDocumentStatus.php
··· 3 3 final class PhrictionDocumentStatus 4 4 extends PhabricatorObjectStatus { 5 5 6 - const STATUS_EXISTS = 0; 7 - const STATUS_DELETED = 1; 8 - const STATUS_MOVED = 2; 9 - const STATUS_STUB = 3; 6 + const STATUS_EXISTS = 'active'; 7 + const STATUS_DELETED = 'deleted'; 8 + const STATUS_MOVED = 'moved'; 9 + const STATUS_STUB = 'stub'; 10 10 11 11 public static function getConduitConstant($const) { 12 12 static $map = array(
+1 -1
src/applications/phriction/query/PhrictionDocumentQuery.php
··· 196 196 if ($this->statuses !== null) { 197 197 $where[] = qsprintf( 198 198 $conn, 199 - 'd.status IN (%Ld)', 199 + 'd.status IN (%Ls)', 200 200 $this->statuses); 201 201 } 202 202
+1 -1
src/applications/phriction/storage/PhrictionDocument.php
··· 31 31 'slug' => 'sort128', 32 32 'depth' => 'uint32', 33 33 'contentID' => 'id?', 34 - 'status' => 'uint32', 34 + 'status' => 'text32', 35 35 'mailKey' => 'bytes20', 36 36 ), 37 37 self::CONFIG_KEY_SCHEMA => array(