mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: don't bump topics when hidden tags are added or removed
This commit is contained in:
@@ -522,7 +522,23 @@ class PostRevisor
|
||||
end
|
||||
|
||||
def bypass_bump?
|
||||
!@post_successfully_saved || @topic_changes.errored? || @opts[:bypass_bump] == true || @post.whisper?
|
||||
!@post_successfully_saved ||
|
||||
@topic_changes.errored? ||
|
||||
@opts[:bypass_bump] == true ||
|
||||
@post.whisper? ||
|
||||
only_hidden_tags_changed?
|
||||
end
|
||||
|
||||
def only_hidden_tags_changed?
|
||||
modifications = post_changes.merge(@topic_changes.diff)
|
||||
if modifications.keys.size == 1 && tags_diff = modifications["tags"]
|
||||
a, b = tags_diff[0] || [], tags_diff[1] || []
|
||||
changed_tags = (a + b) - (a & b)
|
||||
if (changed_tags - DiscourseTagging.hidden_tag_names(nil)).empty?
|
||||
return true
|
||||
end
|
||||
end
|
||||
false
|
||||
end
|
||||
|
||||
def is_last_post?
|
||||
|
||||
Reference in New Issue
Block a user