Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15332540
D13112.id31749.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13112.id31749.diff
View Options
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
@@ -68,8 +68,30 @@
}
// TODO: Remove stuff from search indexes?
- // TODO: PhabricatorFlaggableInterface
- // TODO: PhabricatorTokenReceiverInterface
+
+ if ($object instanceof PhabricatorFlaggableInterface) {
+ $flags = id(new PhabricatorFlag())->loadAllWhere(
+ 'objectPHID = %s', $object_phid);
+
+ foreach ($flags as $flag) {
+ $flag->delete();
+ }
+ }
+
+ $flags = id(new PhabricatorFlag())->loadAllWhere(
+ 'ownerPHID = %s', $object_phid);
+ foreach ($flags as $flag) {
+ $flag->delete();
+ }
+
+ if ($object instanceof PhabricatorTokenReceiverInterface) {
+ $tokens = id(new PhabricatorTokenGiven())->loadAllWhere(
+ 'objectPHID = %s', $object_phid);
+
+ foreach ($tokens as $token) {
+ $token->delete();
+ }
+ }
}
private function destroyEdges($src_phid) {
@@ -116,7 +138,7 @@
}
private function destroyNotifications($object_phid) {
- $table = id(new PhabricatorFeedStoryNotification());
+ $table = new PhabricatorFeedStoryNotification();
$conn_w = $table->establishConnection('w');
queryfx(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 8, 5:48 PM (3 d, 8 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7224385
Default Alt Text
D13112.id31749.diff (1 KB)
Attached To
Mode
D13112: Remove flags and tokens upon object destruction
Attached
Detach File
Event Timeline
Log In to Comment