mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: topic embed blank tags or passed with nil do not blank out existing topic tags (#27699)
When a topic embed is run with either no tags argument or a nil tag argument this should not affect any existing tags. Only update topic tags when tags argument is explicitly empty.
This commit is contained in:
@@ -124,7 +124,7 @@ class TopicEmbed < ActiveRecord::Base
|
||||
existing_tag_names = post.topic.tags.pluck(:name).sort
|
||||
incoming_tag_names = Array(tags).map { |tag| tag.respond_to?(:name) ? tag.name : tag }.sort
|
||||
|
||||
tags_changed = existing_tag_names != incoming_tag_names
|
||||
tags_changed = !tags.nil? && existing_tag_names != incoming_tag_names
|
||||
|
||||
if (content_sha1 != embed.content_sha1) || (title && title != post&.topic&.title) ||
|
||||
tags_changed
|
||||
|
||||
Reference in New Issue
Block a user