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

Allow structured destruction of Maniphest tasks

Summary:
Ref T4749. Ref T3265. Ref T4909.

- Support ManiphestTasks in `bin/remove`.
- Transactions need manual help for now.

Test Plan:
- Destroyed tasks.
- Examined log to verify task, transaction, and comment destruction.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T3265, T4749, T4909

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

+24 -1
+24 -1
src/applications/maniphest/storage/ManiphestTask.php
··· 7 7 PhabricatorTokenReceiverInterface, 8 8 PhabricatorFlaggableInterface, 9 9 PhrequentTrackableInterface, 10 - PhabricatorCustomFieldInterface { 10 + PhabricatorCustomFieldInterface, 11 + PhabricatorDestructableInterface { 11 12 12 13 const MARKUP_FIELD_DESCRIPTION = 'markup:desc'; 13 14 ··· 280 281 public function attachCustomFields(PhabricatorCustomFieldAttachment $fields) { 281 282 $this->customFields = $fields; 282 283 return $this; 284 + } 285 + 286 + 287 + /* -( PhabricatorDestructableInterface )----------------------------------- */ 288 + 289 + 290 + public function destroyObjectPermanently( 291 + PhabricatorDestructionEngine $engine) { 292 + 293 + $this->openTransaction(); 294 + 295 + // TODO: Once this implements PhabricatorTransactionInterface, this 296 + // will be handled automatically and can be removed. 297 + $xactions = id(new ManiphestTransaction())->loadAllWhere( 298 + 'objectPHID = %s', 299 + $this->getPHID()); 300 + foreach ($xactions as $xaction) { 301 + $engine->destroyObject($xaction); 302 + } 303 + 304 + $this->delete(); 305 + $this->saveTransaction(); 283 306 } 284 307 285 308 }