Skip to content

A platform for community discussion. Free, open, simple.

FIX: set microdata schema for topic on missing first post (#25195)

Ayke Halder1a782acd9cd9
diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb
index f798ba319ce..5cc3387360f 100644
--- a/app/views/topics/show.html.erb
+++ b/app/views/topics/show.html.erb
@@ -51,7 +51,7 @@
<% end %>
</div>
- <% if @topic_view.prev_page %>
+ <% if @topic_view.posts&.first && !@topic_view.posts.first.is_first_post? %>
<span itemprop='author' itemscope itemtype="http://schema.org/Person">
<meta itemprop='name' content='<%= @topic_view.topic.user.username %>'>
<link itemprop='url' href='<%= Discourse.base_url %>/u/<%= @topic_view.topic.user.username %>'>