The default welcome (pinned) topic in the Uncategorized category does not show up for anonymous users due to an issue with the discourse-policy plugin. hellekin noticed this behavior, which only occurs on the master site of a multi-site configuration.
When a post contains a policy, the topic disappears for non-registered users. The issue persists even after disabling the plugin, but editing the post while the plugin is disabled resolves the issue. However, re-enabling the plugin causes the topic to disappear again.
hellekin found that the problem is caused by the first response to the topic, which uses the Policy plugin. The error log shows a TypeError, indicating that the plugin is expecting a logged-in user.
Vraag suggested removing the policy post or disabling the plugin as a temporary solution. However, hellekin discovered that simply disabling the plugin is not enough; the post must be edited while the plugin is disabled to restore the topic view.
Currently, the only workaround is to not use the plugin or to use it in private categories where non-registered users cannot see the topic. Vraag pointed out that the current “solution” is essentially not using the plugin.
I noticed something strange about the default welcome (pinned) topic in Uncategorized: it does not show up for anonymous requests.
There is no limit to reading it that I can tell: registration is open, this is the default Uncategorized category (with the special security features) and no setting limits viewing contents.
The JSON view shows the cooked version of the post, yet the HTML version is empty:
@hellekin I have the exact same problem. If you remove the policy post or disable the plugin in the settings the topic will appear.
Looks like there is a bug and non registered users can’t see the topic if a policy is used in a post.
I have been tracking down the culprit: discourse-policy, as @Vraag suggested. Contrary to @Vraag, the plugin affects the “disappearing” topic even when disabled: having it on the plugin list is enough for the topic to “disappear” when logged-out.
Note that plugin.rb loads a whole bunch of dependencies even before doing anything. Maybe the mistake comes from one of these dependencies that would expect a logged-in user.
No, disable the plugin, edit the post containing the plugin (add a random letter at the start of the post for example), save it and unregistered users will be able to see the post
The markup will show as [policy][/policy] and do nothing
I wonder why just disable the plugin isn’t enough. You must edit the post after that or it will continue to have effect
Strangely enough, re-enabling the plugin restores the situation to normal. I’m not sure what to do with this.
I guess this topic will serve for future reference, so here it is: if some topic “disappears” from anonymous view, and you have a post using the discourse-policy plugin…
disable the plugin – if that does not work: remove it from the container’s YAML configuration file and rebuild.
edit the post using [policy] tag so that it’s rebaked and disabled (maybe rebuild HTML is enough?)
[policy group=testgroup reminder=daily]
Test
[/policy]
Which does not fix the problem. More than a fix, that’s… just not using the plugin.
If I edit the post or rebuild HTML the plugin will work, but the topic will disappear for non-registered users again
edit
It is the same for you from what I can see. In your topic the second post looks like this:
[policy group=trust_level_1 reminder=daily]
We do not use third-party cookies.
[/policy]
So we still have no “solution”. Unless you call solution not using the plugin xD. You might as well have deleted the markup from the second post, same result.
As it is now you can only use it in private categories, so that non registered users can’t see the topic anyway.