mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
[bug fix] When recovering a post, at times the topic related to the post still returns nil.
Use the with_deleted method to include topics that have been soft deleted so that they too can be recovered.
This commit is contained in:
parent
663cd93c6d
commit
dfda153ffa
1 changed files with 3 additions and 2 deletions
|
@ -54,8 +54,9 @@ class PostDestroyer
|
|||
elsif @user.staff? || @user.id == @post.user_id
|
||||
user_recovered
|
||||
end
|
||||
@post.topic.recover! if @post.post_number == 1
|
||||
@post.topic.update_statistics
|
||||
topic = Topic.with_deleted.find @post.topic_id
|
||||
topic.recover! if @post.post_number == 1
|
||||
topic.update_statistics
|
||||
end
|
||||
|
||||
def staff_recovered
|
||||
|
|
Loading…
Reference in a new issue