Creating a new category – Issue to set up (admin only) privileges

Hello friends,

after trying to add a new sub category to my Discourse instance, I’ve noticed the following error:

My intention was, to make this category only available for admins. Instead of “admins”, a user group called “undefined” was added and I’ve got this error message. In case of making this category available for everyone, everything works fines.

Any clue why this error message occurs?

Best

(Version v1.9.0.beta13 +110)

4 Likes

I can repro this error on Try. Attempting to change the security permissions (even if reverting them back to everyone) causes the 500 error. Nothing in site logs either.

5 Likes

Can you take this @tgxworld?

3 Likes

@joffreyjaffeux Can you have a look at this instead? It looks like after switching combo-box to use select-box-kit, the default value is not assigned.

weird it’s actually one of the screen I always use for testing… checking this

5 Likes

@jomaxro gave me this repro, but I can’t repro:

1. Navigate to `/categories`
2. Click "New Category"
3. Provide a category name
4. Switch to Security tab
5. Click "Edit Permissions"
6. Delete "`everyone` can... Create / Reply / See"
7. Select "admins" from dropdown and click "Add Permission"
8. Note that after adding "admins" is not displayed but "undefined"
9. Click "New Category"
10. Get 500 Error

Someone else can repro with this ? or has a better repro?

Ok I finally repro-ed it, thanks.

3 Likes

This should be fixed by:

https://github.com/discourse/discourse/commit/9406eee179b6627691c287272f2677c734150324

1 Like

Hmm the fix doesn’t look right.

https://github.com/discourse/discourse/blob/9406eee179b6627691c287272f2677c734150324/app/assets/javascripts/discourse/templates/components/edit-category-security.hbs#L18-L23

I think the problem is with the combo-box not having a default value when I don’t make any selections.

Screenshot from 2017-10-30 15-37-05

Ok after discussion with @tgxworld there was indeed two issues, a bug in select-box and a very specific behavior of this combo box (removing content of the array when an item is selected). So my commit was mostly fixing the second issue and not the first.

This commit should be more appropriate thx @tgxworld:

https://github.com/discourse/discourse/commit/43920827ed29bc2dfbceeec85958287206235e21

7 Likes

This topic was automatically closed after 40 hours. New replies are no longer allowed.