@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 pastes to be destroyed

Summary: Fixes T6186.

Test Plan:
- Used `bin/remove destroy Pxxx` to destroy a paste.
- Verified file, transactions, etc., were destroyed.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T6186

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

+41 -1
+2
src/__phutil_library_map__.php
··· 4855 4855 'PhabricatorMentionableInterface', 4856 4856 'PhabricatorPolicyInterface', 4857 4857 'PhabricatorProjectInterface', 4858 + 'PhabricatorDestructibleInterface', 4859 + 'PhabricatorApplicationTransactionInterface', 4858 4860 ), 4859 4861 'PhabricatorPasteApplication' => 'PhabricatorApplication', 4860 4862 'PhabricatorPasteCommentController' => 'PhabricatorPasteController',
+39 -1
src/applications/paste/storage/PhabricatorPaste.php
··· 7 7 PhabricatorFlaggableInterface, 8 8 PhabricatorMentionableInterface, 9 9 PhabricatorPolicyInterface, 10 - PhabricatorProjectInterface { 10 + PhabricatorProjectInterface, 11 + PhabricatorDestructibleInterface, 12 + PhabricatorApplicationTransactionInterface { 11 13 12 14 protected $title; 13 15 protected $authorPHID; ··· 150 152 151 153 public function describeAutomaticCapability($capability) { 152 154 return pht('The author of a paste can always view and edit it.'); 155 + } 156 + 157 + 158 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 159 + 160 + 161 + public function destroyObjectPermanently( 162 + PhabricatorDestructionEngine $engine) { 163 + 164 + if ($this->filePHID) { 165 + $file = id(new PhabricatorFileQuery()) 166 + ->setViewer(PhabricatorUser::getOmnipotentUser()) 167 + ->withPHIDs(array($this->filePHID)) 168 + ->executeOne(); 169 + if ($file) { 170 + $engine->destroyObject($file); 171 + } 172 + } 173 + 174 + $this->delete(); 175 + } 176 + 177 + 178 + /* -( PhabricatorApplicationTransactionInterface )------------------------- */ 179 + 180 + 181 + public function getApplicationTransactionEditor() { 182 + return new PhabricatorPasteEditor(); 183 + } 184 + 185 + public function getApplicationTransactionObject() { 186 + return $this; 187 + } 188 + 189 + public function getApplicationTransactionTemplate() { 190 + return new PhabricatorPasteTransaction(); 153 191 } 154 192 155 193 }