diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -3575,6 +3575,7 @@ 'HeraldTranscript' => array( 'HeraldDAO', 'PhabricatorPolicyInterface', + 'PhabricatorDestructibleInterface', ), 'HeraldTranscriptController' => 'HeraldController', 'HeraldTranscriptGarbageCollector' => 'PhabricatorGarbageCollector', diff --git a/src/applications/herald/storage/transcript/HeraldTranscript.php b/src/applications/herald/storage/transcript/HeraldTranscript.php --- a/src/applications/herald/storage/transcript/HeraldTranscript.php +++ b/src/applications/herald/storage/transcript/HeraldTranscript.php @@ -1,7 +1,9 @@ openTransaction(); + $this->delete(); + $this->saveTransaction(); + } + + } diff --git a/src/applications/system/engine/PhabricatorDestructionEngine.php b/src/applications/system/engine/PhabricatorDestructionEngine.php --- a/src/applications/system/engine/PhabricatorDestructionEngine.php +++ b/src/applications/system/engine/PhabricatorDestructionEngine.php @@ -48,6 +48,19 @@ } } + // Nuke any Herald transcripts of the object, because they may contain + // field data. + + // TODO: Define an interface so we don't have to do this for transactions + // and other objects with no Herald adapters? + $transcripts = id(new HeraldTranscript())->loadAllWhere( + 'objectPHID = %s', + $object_phid); + foreach ($transcripts as $transcript) { + $transcript->destroyObjectPermanently($this); + } + + // TODO: Remove stuff from search indexes? // TODO: PhabricatorFlaggableInterface // TODO: PhabricatorTokenReceiverInterface }