I can't display my policy

Hello! :grinning:

I’ve installed the discourse-policy plugin, and it’s accessible at https://discourse.localhost/admin/plugins.

However, I can’t display my policy:

[policy group=admins reminder=daily]
I accept this policy will annoy me daily until I click accept
[/policy]

Here the result:

The policy is not rendered in HTML.

I tried to add and change the group parameter too.

Thanks for your help!

1 Like

Hi @johackim :wave: welcome to Meta :slight_smile:

Perhaps make sure you have the plugin enabled in admin-settings policy enabled

policy

Although, if you can use the create policy button on the composer toolbar, then it must be enabled :thinking:

I just made a new policy on one of my instances and it seems to be working as expected. I even copied and pasted your code above and successfully created a policy post. What happens when you rebuild html on that policy post? (click admin-wrench below post, rebuild html).

2 Likes

Hello @Lilly, thanks for your reply!

The plugin is enabled:

And I can create a policy with the “Create policy” button.

However, the policy is not rendered in the topic :pensive:

PS: I use discourse 3.1.0

1 Like

Hello :wave:

This format seems uncorrect…

I think it should be group="admins" reminder="daily"

I am not too familiar with this plugin. Is this works like this?

[policy group="admins" reminder="daily" version="1"]
I accept this policy will annoy me daily until I click accept
[/policy]

Here are some example:

2 Likes

yes @johackim it looks like what Don pointed out. If you use the “Create Policy” button in the extra part of the topic composer toolbar (the gear icon), it does this:

[policy reminder="daily" version="1" groups="testgroup"]
I accept this test policy
[/policy]

1 Like

I tried all ways (even from the “Create policy” button):

Hmmm. Are you on the latest Discourse version, either stable 3.1.0 or 3.2.0.beta1-dev? :thinking:

I use Discourse 3.1.0

1 Like

Is your user an admin or moderator?

Not sure if the policy_restrict_to_staff_posts setting is getting in your way. Try disabling it?

1 Like

I tried with an admin and a simple user.

I disabled policy_restrict_to_staff_posts too.

Doesn’t change.

I just tested this on my site and it works out of the box, without changing any settings from the default.

There is something interfering on your site - please try safe mode (add /safe-mode to your site URL) and see if you can get it working with the first two options selected.

You might also want to look in the logs and in the chrome javascript console.

1 Like

Same thing with the safe mode:

Something weird is going on here. Before you post the policy, does it render in the editor previewer?

I can copy and paste your code and successfully create policy posts. So I am thinking it is something else like the BBcode rendering or a broken plugin even. Are you able to successfully render some of the other editor toolbar functions, like build poll, blur spoiler or hide details?

Here the editor preview:

The display seems to work in this editor preview mode.

And here the render:

The “pool” plugin works well.

The spoiler plugin doesn’t seem to render HTML either.

Just to be sure, is this a standard install?

1 Like

Anything in the logs or javascript console?

Assuming you are on a standard install and have updated to latest, you are looking at a rogue plugin or theme. If safe mode with only official plugins and themes is still breaking, then it seems it’s one of ours.

You are going to have to start removing plugins and themes to find out which one is the culprit.

1 Like

I use the bitnami/discourse docker image.

Sorry, but Bitnami installations are unsupported.

3 Likes

I wonder if there’s a compatibility issue? :thinking: I think I’ve seen that before with bitnami and some other plugins.

The standard install is the best bet to get a solid install that works with all the official plugins. If you can move away from the bitnami one and onto that, you might find it solves a lot of problems (now and in the future :slight_smile:). You’ll also get the added bonus of being able to get support from people on here as well. :partying_face:

3 Likes