codidact / qpixel

Q&A-based community knowledge-sharing software
https://codidact.com
GNU Affero General Public License v3.0
385 stars 68 forks source link

List of posts for a tag shows only that tag, omitting other tags on those posts #1291

Closed cellio closed 9 months ago

cellio commented 9 months ago

meta:289520

The list of posts for a specific tag (example) includes the post titles, types, and categories, as you would expect, and: one tag, even if the post has other tags. (That example link is from Meta, which has required tags, so all of those posts have at least one more tag.)

Other post lists, like the category list and the list on the user profile, get this right. I thought I could look to see what those other places do and then emulate that on the tag page. To my surprise, the calling code is already identical:

<div class="item-list">
  <% @posts.each do |post| %>
    <%= render 'posts/type_agnostic', post: post, show_type_tag: true, show_category_tag: true %>
  <% end %>
</div>

That's in app/views/tags/show.html.erb and app/views/users/posts.html.erb. So there must be some difference in context that affects this rendering, but that's where I ran out of ideas and filed this bug instead of fixing it.