mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
FIX: Make deleted topic post bookmarks more resilient (#10619)
This PR ensures that new bookmarks cannot be created for deleted posts and topics, and also makes sure that if a bookmark was created and then the topic deleted that the show topic page does not error from trying to retrieve the bookmark reminder at.
This commit is contained in:
@ -356,7 +356,8 @@ class TopicView
|
||||
end
|
||||
|
||||
def first_post_bookmark_reminder_at
|
||||
@topic.first_post.bookmarks.where(user: @user).pluck_first(:reminder_at)
|
||||
@topic.posts.with_deleted.where(post_number: 1).first
|
||||
.bookmarks.where(user: @user).pluck_first(:reminder_at)
|
||||
end
|
||||
|
||||
MAX_PARTICIPANTS = 24
|
||||
|
Reference in New Issue
Block a user