@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 diviner books to be permanently destroyed

Summary: Fixes T7182.

Test Plan: Deleted a book with `./bin/remove destroy`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7182

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

+46 -2
+24 -1
src/applications/diviner/storage/DivinerLiveBook.php
··· 1 1 <?php 2 2 3 3 final class DivinerLiveBook extends DivinerDAO 4 - implements PhabricatorPolicyInterface { 4 + implements 5 + PhabricatorPolicyInterface, 6 + PhabricatorDestructibleInterface { 5 7 6 8 protected $name; 7 9 protected $viewPolicy; ··· 80 82 81 83 public function describeAutomaticCapability($capability) { 82 84 return null; 85 + } 86 + 87 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 88 + 89 + public function destroyObjectPermanently( 90 + PhabricatorDestructionEngine $engine) { 91 + 92 + $this->openTransaction(); 93 + $atoms = id(new DivinerAtomQuery()) 94 + ->setViewer(PhabricatorUser::getOmnipotentUser()) 95 + ->withBookPHIDs(array($this->getPHID())) 96 + ->withIncludeGhosts(true) 97 + ->withIncludeUndocumentable(true) 98 + ->execute(); 99 + 100 + foreach ($atoms as $atom) { 101 + $engine->destroyObject($atom); 102 + } 103 + 104 + $this->delete(); 105 + $this->saveTransaction(); 83 106 } 84 107 85 108 }
+22 -1
src/applications/diviner/storage/DivinerLiveSymbol.php
··· 1 1 <?php 2 2 3 3 final class DivinerLiveSymbol extends DivinerDAO 4 - implements PhabricatorPolicyInterface, PhabricatorMarkupInterface { 4 + implements 5 + PhabricatorPolicyInterface, 6 + PhabricatorMarkupInterface, 7 + PhabricatorDestructibleInterface { 5 8 6 9 protected $bookPHID; 7 10 protected $context; ··· 240 243 241 244 public function shouldUseMarkupCache($field) { 242 245 return true; 246 + } 247 + 248 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 249 + 250 + public function destroyObjectPermanently( 251 + PhabricatorDestructionEngine $engine) { 252 + 253 + $this->openTransaction(); 254 + $conn_w = $this->establishConnection('w'); 255 + 256 + queryfx( 257 + $conn_w, 258 + 'DELETE FROM %T WHERE symbolPHID = %s', 259 + id(new DivinerLiveAtom())->getTableName(), 260 + $this->getPHID()); 261 + 262 + $this->delete(); 263 + $this->saveTransaction(); 243 264 } 244 265 245 266 }