From a0474a07745596a107384b9feb0d5bf1d408605a Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Fri, 7 Jun 2019 14:57:45 +1000 Subject: [PATCH] FIX: always take the first post in the RSS fee `.posts.first` may be the first post and may not, depending on luck Also add protection for corrupt topics --- app/views/list/list.rss.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/list/list.rss.erb b/app/views/list/list.rss.erb index 69799bc5934..8824eeb86b0 100644 --- a/app/views/list/list.rss.erb +++ b/app/views/list/list.rss.erb @@ -23,7 +23,9 @@

<%= t('author_wrote', author: link_to("@#{username}", "#{Discourse.base_url}/u/#{topic.user.username_lower}")).html_safe %>

<% end %>
- <%= topic.posts.first.cooked.html_safe %> + <%- if first_post = topic.ordered_posts.first %> + <%= first_post.cooked.html_safe %> + <%- end %>

<%= t 'num_posts' %> <%= topic.posts_count %>

<%= t 'num_participants' %> <%= topic.participant_count %>