mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/12371] Do not delete post related notifications when a post is deleted
When a post is marked edited and therefor marked as softdeleted/unapproved, we should not delete the notifications, just like we can't delete the emails. Links are out there anyway and just keeping the notification is fail save. If we keep the notification we can just continue to update it when more posts are added. Also when we delete a post, we don't have to go though the table and find all related notifications to be able to delete them or even update them, when they have responders set. PHPBB3-12371
This commit is contained in:
parent
e0fadfb4d6
commit
92db22c882
2 changed files with 2 additions and 25 deletions
|
@ -736,8 +736,6 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||||
// Notifications types to delete
|
// Notifications types to delete
|
||||||
$delete_notifications_types = array(
|
$delete_notifications_types = array(
|
||||||
'quote',
|
'quote',
|
||||||
'bookmark',
|
|
||||||
'post',
|
|
||||||
'approve_post',
|
'approve_post',
|
||||||
'post_in_queue',
|
'post_in_queue',
|
||||||
);
|
);
|
||||||
|
|
|
@ -2272,16 +2272,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||||
case 'edit_first_post':
|
case 'edit_first_post':
|
||||||
case 'edit':
|
case 'edit':
|
||||||
case 'edit_last_post':
|
case 'edit_last_post':
|
||||||
if ($data['topic_visibility'] != ITEM_APPROVED)
|
// Nothing to do here
|
||||||
{
|
|
||||||
$phpbb_notifications->delete_notifications('topic', $data['topic_id']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$phpbb_notifications->delete_notifications(array(
|
|
||||||
'quote',
|
|
||||||
'bookmark',
|
|
||||||
'post',
|
|
||||||
), $data['post_id']);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2292,23 +2283,11 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||||
case 'post':
|
case 'post':
|
||||||
case 'reply':
|
case 'reply':
|
||||||
case 'quote':
|
case 'quote':
|
||||||
// Nothing to do here
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'edit_topic':
|
case 'edit_topic':
|
||||||
case 'edit_first_post':
|
case 'edit_first_post':
|
||||||
case 'edit':
|
case 'edit':
|
||||||
case 'edit_last_post':
|
case 'edit_last_post':
|
||||||
if ($data['topic_visibility'] != ITEM_APPROVED)
|
// Nothing to do here
|
||||||
{
|
|
||||||
$phpbb_notifications->delete_notifications('topic', $data['topic_id']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$phpbb_notifications->delete_notifications(array(
|
|
||||||
'quote',
|
|
||||||
'bookmark',
|
|
||||||
'post',
|
|
||||||
), $data['post_id']);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue