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

When destroying an object, destroy its Herald transcripts too

Summary: Ref T5915. Make `bin/remove destroy` a bit more thorough, since Herald transcripts can have field information in them.

Test Plan: Used `bin/remove destroy` to nuke revisions, saw their transcripts vanish too.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5915

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

+29 -1
+1
src/__phutil_library_map__.php
··· 3575 3575 'HeraldTranscript' => array( 3576 3576 'HeraldDAO', 3577 3577 'PhabricatorPolicyInterface', 3578 + 'PhabricatorDestructibleInterface', 3578 3579 ), 3579 3580 'HeraldTranscriptController' => 'HeraldController', 3580 3581 'HeraldTranscriptGarbageCollector' => 'PhabricatorGarbageCollector',
+15 -1
src/applications/herald/storage/transcript/HeraldTranscript.php
··· 1 1 <?php 2 2 3 3 final class HeraldTranscript extends HeraldDAO 4 - implements PhabricatorPolicyInterface { 4 + implements 5 + PhabricatorPolicyInterface, 6 + PhabricatorDestructibleInterface { 5 7 6 8 protected $objectTranscript; 7 9 protected $ruleTranscripts = array(); ··· 193 195 return pht( 194 196 'To view a transcript, you must be able to view the object the '. 195 197 'transcript is about.'); 198 + } 199 + 200 + 201 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 202 + 203 + 204 + public function destroyObjectPermanently( 205 + PhabricatorDestructionEngine $engine) { 206 + 207 + $this->openTransaction(); 208 + $this->delete(); 209 + $this->saveTransaction(); 196 210 } 197 211 198 212
+13
src/applications/system/engine/PhabricatorDestructionEngine.php
··· 48 48 } 49 49 } 50 50 51 + // Nuke any Herald transcripts of the object, because they may contain 52 + // field data. 53 + 54 + // TODO: Define an interface so we don't have to do this for transactions 55 + // and other objects with no Herald adapters? 56 + $transcripts = id(new HeraldTranscript())->loadAllWhere( 57 + 'objectPHID = %s', 58 + $object_phid); 59 + foreach ($transcripts as $transcript) { 60 + $transcript->destroyObjectPermanently($this); 61 + } 62 + 63 + // TODO: Remove stuff from search indexes? 51 64 // TODO: PhabricatorFlaggableInterface 52 65 // TODO: PhabricatorTokenReceiverInterface 53 66 }