FIX: cannot remove tags from a topic

This commit is contained in:
Neil Lalonde
2016-06-09 12:04:34 -04:00
parent 5a03eca74a
commit 5047979f96
2 changed files with 19 additions and 0 deletions
+11
View File
@@ -84,6 +84,17 @@ class PostRevisor
end
end
track_topic_field(:tags_empty_array) do |tc, val|
if val.present? && tc.guardian.can_tag_topics?
prev_tags = tc.topic.tags.map(&:name)
if !DiscourseTagging.tag_topic_by_names(tc.topic, tc.guardian, [])
tc.check_result(false)
next
end
tc.record_change('tags', prev_tags, nil)
end
end
# AVAILABLE OPTIONS:
# - revised_at: changes the date of the revision
# - force_new_version: bypass ninja-edit window