Skip to content

Commit

Permalink
#3412 Clean up notifications on announcement deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Mar 2, 2018
1 parent abb9a30 commit 20f2a83
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions classes/announcement/AnnouncementDAO.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ function deleteObject($announcement) {
* @return boolean
*/
function deleteById($announcementId) {
$notificationDao = DAORegistry::getDAO('NotificationDAO');
$notificationDao->deleteByAssoc(ASSOC_TYPE_ANNOUNCEMENT, $announcementId);

$this->update('DELETE FROM announcement_settings WHERE announcement_id = ?', (int) $announcementId);
return $this->update('DELETE FROM announcements WHERE announcement_id = ?', (int) $announcementId);
}
Expand Down

0 comments on commit 20f2a83

Please sign in to comment.