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

Destroy notifications properly from `bin/remove destroy`

Summary: Fixes T8237. This table is unusual and doesn't have an `id` column, so `delete()` doesn't actually know how to delete records and fails.

Test Plan:
- Used `bin/remove destroy` to destroy an object with notifications, as per T8237.
- Applied patch.
- Used `bin/remove destroy` to get a clean delete.
- Verified related notifications vanished from notification menu.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8237

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

+7 -6
+7 -6
src/applications/system/engine/PhabricatorDestructionEngine.php
··· 116 116 } 117 117 118 118 private function destroyNotifications($object_phid) { 119 - $notifications = id(new PhabricatorFeedStoryNotification())->loadAllWhere( 120 - 'primaryObjectPHID = %s', 119 + $table = id(new PhabricatorFeedStoryNotification()); 120 + $conn_w = $table->establishConnection('w'); 121 + 122 + queryfx( 123 + $conn_w, 124 + 'DELETE FROM %T WHERE primaryObjectPHID = %s', 125 + $table->getTableName(), 121 126 $object_phid); 122 - 123 - foreach ($notifications as $notification) { 124 - $notification->delete(); 125 - } 126 127 } 127 128 128 129 }