Custom groups field is blank

AI-generated summary

A bug was reported where the custom groups field appears blank in the admin user interface, preventing users from being added to custom groups ky_metro. The reporter initially suspected a recent commit, noting duplicate key errors when attempting to add users ky_metro. Upon further investigation, it was clarified that the field remains empty even for users who are already members of a group ky_metro. The issue was identified by eviltrout and resolved by sam. The root cause was found to be custom groups that are not publicly visible. A fix was implemented in a specific commit, and it was noted that the group admin page itself functions correctly sam.

I’m no longer able to add users to custom groups , as of 4bad697. EDIT: see post below.

I’ve tried both in the groups page and on the admin user page. The latter sometimes gives “An error has occured”. Sometimes it appears to work but doesn’t stick, on page reload the group is gone.

This worked fine yesterday. Pretty sure this latest version introduced the problem.

Logged error:

ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_group_users_on_group_id_and_user_id"
DETAIL:  Key (group_id, user_id)=(41, 1494) already exists.
: INSERT INTO "group_users" ("created_at", "group_id", "updated_at", "user_id") VALUES ($1, $2, $3, $4) RETURNING "id")
1 « J'aime »

After looking at this again, it appears to be very simple… the “custom groups” field is not showing anything even when it exists for a user. I verified this by checking a user I know is in a group; the field is still blank.

Changing the title to reflect this.

3 « J'aime »

One for you to check out @sam, with that pesky groups admin.

I just fixed this, this happens when a custom group is not publicly visible.

https://github.com/discourse/discourse/commit/4919ec4c44ab7f840aad891f1896fb7353fe8205

Its actually an issue with admin/users the group admin page is all good here.

3 « J'aime »