FIX: composer problem on the categories page (PR #9508)

When the user is on /categories page and tries to create a new topic, an error is raised.

Problem is that on categories we are using topics.posters to display avatars. discourse/topic.js at master · discourse/discourse · GitHub

Then, when the user is trying to compose a new topic, we are sending a query to get similar topics

Serializer is trying to add posters but in the end, it is an empty array -

Reason for that is that posters is just accessor discourse/topic.rb at master · discourse/discourse · GitHub

That accessor is populated when topics are received using topics query discourse/topic_query.rb at 3d9c320aabd54c3cce1bb4e9f29769f0d7c4c9ab · discourse/discourse · GitHub

However, when we are looking for similar topics, posters field is not populated and avatars are crashing on /categories page.

The solution is to fall back to posters_summary

GitHub