Bug in docs plugin: Pinned topics are not at the top

AI-generated summary

The discussion revolves around a bug in the Discourse Docs plugin where pinned topics are not displayed at the top in the docs page. jrgong initially reported the issue with Discourse version 2.8.1 and Docs plugin version 0.1. SaraDev was unable to reproduce the issue with Discourse version 2.9.0.beta2, suggesting it might be related to the Discourse version.

However, maiki was able to reproduce the issue with 2.9.0.beta3, explaining that the docs index defaults to recent activity and doesn’t sort by pinned status. The issue persists even after updating to Discourse 3.2 and the latest Docs plugin version, as confirmed by jrgong.

sam noted that fixing this issue would require a significant change to both the core and the plugin, involving moving the ordering logic from the plugin to the core. Unfortunately, this bug has been put on the backburner for now, and a solution or workaround has not been found yet, as jrgong is still seeking a resolution.

Whenever a topic is pinned in a category, it’s not pinned to the top in docs

You can see the behaviour in action here: https://forum.cannabisanbauen.net/docs?tags=01-grundlagen
Is that expected behaviour or a bug?

Discourse version: 2.8.1
Docs plugin version: 0.1

1 Like

I just tried testing this with Discourse version 2.9.0.beta2 and was unable to reproduce the issue. A pinned topic in a category included in Docs appears to be pinned successfully on the docs page, as expected.

This issue might just be related to Discourse version: 2.8.1, and you could try updating Discourse to resolve this.

Docs plugin version: 0.1

2 Likes

I can reproduce this with 2.9.0.beta3. The docs index appears to default to recent activity, and doesn’t sort by pinned status; it does, however, show the correct pinned status by icon.

I pinned the first doc I created, hence it is the “oldest”:

I updated the pinned doc, making it the more recent activity:

And added a new doc, which then becomes the most recent:


I changed the pinned status on the topic (meaning the discussion, the “docs view” does not show the pinned status).

And it updated on the docs index:


Notes:

  • I tried a category and global pin: same results
  • Any activity bumps the doc in the index: the more recently discussed topics will be at the top
3 Likes

Sadly this is quite a major change to both core and the plugin.

Tough we use TopicQuery to get the lists of topics, we handle all ordering outside of TopicQuery in:

To complete this we would probably need to move it so “core” handles ordering here instead of the plugin doing its own thing. It is a very complex change.

On the upside we can potentially remove a bunch of code from the plugin.

Sorry but I got to put this bug on the backburner for now.

3 Likes

it seems, this issue still persists? We just tested on 3.2 and latest docs plugin version. Pinned topics are not displayed at the top in docs.

Has anyone been able to find a solution or workaround?