mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
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
This commit is contained in:
parent
107d6db1e8
commit
4250719d10
1 changed files with 7 additions and 6 deletions
|
@ -116,13 +116,14 @@ final class PhabricatorDestructionEngine extends Phobject {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function destroyNotifications($object_phid) {
|
private function destroyNotifications($object_phid) {
|
||||||
$notifications = id(new PhabricatorFeedStoryNotification())->loadAllWhere(
|
$table = id(new PhabricatorFeedStoryNotification());
|
||||||
'primaryObjectPHID = %s',
|
$conn_w = $table->establishConnection('w');
|
||||||
|
|
||||||
|
queryfx(
|
||||||
|
$conn_w,
|
||||||
|
'DELETE FROM %T WHERE primaryObjectPHID = %s',
|
||||||
|
$table->getTableName(),
|
||||||
$object_phid);
|
$object_phid);
|
||||||
|
|
||||||
foreach ($notifications as $notification) {
|
|
||||||
$notification->delete();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue