mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: 'only_hidden_tags_changed?' method returned 'true' even when tags are not changed.
While editing the first post it does't bumped the topic when the new post revision created. Because we wrongly assumed that the hidden tags are changed even when no tags are updated.
This commit is contained in:
@@ -522,14 +522,17 @@ class PostRevisor
|
||||
end
|
||||
|
||||
def only_hidden_tags_changed?
|
||||
return false if (hidden_tag_names = DiscourseTagging.hidden_tag_names).blank?
|
||||
|
||||
modifications = post_changes.merge(@topic_changes.diff)
|
||||
if modifications.keys.size == 1 && tags_diff = modifications["tags"]
|
||||
if modifications.keys.size == 1 && (tags_diff = modifications["tags"]).present?
|
||||
a, b = tags_diff[0] || [], tags_diff[1] || []
|
||||
changed_tags = ((a + b) - (a & b)).map(&:presence).compact
|
||||
if (changed_tags - DiscourseTagging.hidden_tag_names(nil)).empty?
|
||||
if (changed_tags - hidden_tag_names).empty?
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
false
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user