From 6b7931bcc86accf00c8ff2b2ea7657d27b290f10 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 18 Dec 2010 02:39:44 -0500 Subject: [PATCH] delete bookmark stuff when deleting notice --- plugins/Bookmark/BookmarkPlugin.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php index a3067a9eb1..2137d0c225 100644 --- a/plugins/Bookmark/BookmarkPlugin.php +++ b/plugins/Bookmark/BookmarkPlugin.php @@ -76,6 +76,17 @@ class BookmarkPlugin extends Plugin return true; } + function onNoticeDeleteRelated($notice) + { + $nb = Notice_bookmark::staticGet('notice_id', $notice->id); + + if (!empty($nb)) { + $nb->delete(); + } + + return true; + } + /** * Load related modules when needed * -- 2.39.5