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

Freeze "maniphest.gettasktransactions" and make status/priority transactions more consistent

Summary:
Ref T13020. See PHI221.

Freeze legacy method `maniphest.gettasktransactions` in favor of modern method `transaction.search`.

Remove legacy "null on create" behavior from Maniphest status and priority transactions. This behavior is obsolete with EditEngine, and leads to inconsistent transaction sets in the transaction record.

The desired behavior is that transactions which don't do anything (e.g., default value was not changed) don't appear in the transaction log.

Test Plan:
- Viewed API UI and saw `maniphest.gettasktransactions` marked as "Frozen".
- Created a new task via web UI (without changing status/priority), queried transactions with `maniphest.gettasktransacitons`/`transaction.search`, no longer saw "null on create" no-op transactions in record.
- Web UI is unchanged, since these transactions were hidden before and now do not exist.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13020

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

+13 -9
+10
src/applications/maniphest/conduit/ManiphestGetTaskTransactionsConduitAPIMethod.php
··· 21 21 return 'nonempty list<dict<string, wild>>'; 22 22 } 23 23 24 + public function getMethodStatus() { 25 + return self::METHOD_STATUS_FROZEN; 26 + } 27 + 28 + public function getMethodStatusDescription() { 29 + return pht( 30 + 'This method is frozen and will eventually be deprecated. New code '. 31 + 'should use "transaction.search" instead.'); 32 + } 33 + 24 34 protected function execute(ConduitAPIRequest $request) { 25 35 $results = array(); 26 36 $task_ids = $request->getValue('ids');
+3 -6
src/applications/maniphest/xaction/ManiphestTaskPriorityTransaction.php
··· 6 6 const TRANSACTIONTYPE = 'priority'; 7 7 8 8 public function generateOldValue($object) { 9 - if ($this->isNewObject()) { 10 - return null; 11 - } 12 - return $object->getPriority(); 9 + return (string)$object->getPriority(); 13 10 } 14 11 15 12 public function generateNewValue($object, $value) { 16 13 // `$value` is supposed to be a keyword, but if the priority 17 14 // assigned to a task has been removed from the config, 18 15 // no such keyword will be available. Other edits to the task 19 - // should still be allowed, even if the priority is no longer 16 + // should still be allowed, even if the priority is no longer 20 17 // valid, so treat this as a no-op. 21 18 if ($value === ManiphestTaskPriority::UNKNOWN_PRIORITY_KEYWORD) { 22 - return $object->getPriority(); 19 + return (string)$object->getPriority(); 23 20 } 24 21 25 22 return (string)ManiphestTaskPriority::getTaskPriorityFromKeyword($value);
-3
src/applications/maniphest/xaction/ManiphestTaskStatusTransaction.php
··· 6 6 const TRANSACTIONTYPE = 'status'; 7 7 8 8 public function generateOldValue($object) { 9 - if ($this->isNewObject()) { 10 - return null; 11 - } 12 9 return $object->getStatus(); 13 10 } 14 11