diff --git a/app/views/list/related_topics.html.erb b/app/views/list/related_topics.html.erb
index 27703799..bd7cb4c7 100644
--- a/app/views/list/related_topics.html.erb
+++ b/app/views/list/related_topics.html.erb
@@ -40,19 +40,6 @@
<% end %>
- <% if t.pinned_until && (t.pinned_until > Time.zone.now) && (t.pinned_globally || t.category) && t.excerpt %>
-
- <%= t.excerpt.html_safe %>
-
- <% end %>
-
-
- <% t.posters.each do |poster| %>
-
- <% end %>
|
'><%= t.posts_count - 1 %>
diff --git a/lib/embeddings/semantic_related.rb b/lib/embeddings/semantic_related.rb
index af03f806..da813703 100644
--- a/lib/embeddings/semantic_related.rb
+++ b/lib/embeddings/semantic_related.rb
@@ -67,7 +67,7 @@ module DiscourseAi
topic = topic_view&.topic
return "" if !topic
- related_topics ||= SemanticTopicQuery.new(nil).list_semantic_related_topics(topic).topics
+ related_topics = SemanticTopicQuery.new(nil).list_semantic_related_topics(topic).topics
return "" if related_topics.empty?
diff --git a/lib/embeddings/strategies/truncation.rb b/lib/embeddings/strategies/truncation.rb
index 39d8871f..6f57b12c 100644
--- a/lib/embeddings/strategies/truncation.rb
+++ b/lib/embeddings/strategies/truncation.rb
@@ -28,14 +28,20 @@ module DiscourseAi
def topic_information(topic)
info = +""
- info << topic.title
- info << "\n\n"
- info << topic.category.name if topic&.category&.name
- if SiteSetting.tagging_enabled
+ if topic&.title.present?
+ info << topic.title
info << "\n\n"
- info << topic.tags.pluck(:name).join(", ")
end
- info << "\n\n"
+ if topic&.category&.name.present?
+ info << topic.category.name
+ info << "\n\n"
+ end
+ if SiteSetting.tagging_enabled && topic&.tags.present?
+ info << topic.tags.pluck(:name).join(", ")
+ info << "\n\n"
+ end
+
+ info
end
def topic_truncation(topic, tokenizer, max_length)
|