Page MenuHomePhabricator

D10306.diff
No OneTemporary

D10306.diff

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 @@
<?php
final class HeraldTranscript extends HeraldDAO
- implements PhabricatorPolicyInterface {
+ implements
+ PhabricatorPolicyInterface,
+ PhabricatorDestructibleInterface {
protected $objectTranscript;
protected $ruleTranscripts = array();
@@ -196,4 +198,16 @@
}
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->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
}

File Metadata

Mime Type
text/plain
Expires
Fri, May 10, 11:32 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6284389
Default Alt Text
D10306.diff (2 KB)

Event Timeline