# Custom groups field is blank

**URL:** https://meta.discourse.org/t/custom-groups-field-is-blank/26730
**Category:** Bug
**Created:** [March 25, 2015, 12:41am UTC](https://meta.discourse.org/t/custom-groups-field-is-blank/26730 "2015-03-25T00:41:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ky\_metro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ky_metro/32/42807_2.png) [@ky\_metro](https://meta.discourse.org/u/ky_metro)
#### Post date: [March 25, 2015, 12:41am UTC](https://meta.discourse.org/t/custom-groups-field-is-blank/26730/1 "2015-03-25T00:41:51Z")

</div>

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")

```

---

<div class="post-metadata">

### Author: ![ky\_metro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ky_metro/32/42807_2.png) [@ky\_metro](https://meta.discourse.org/u/ky_metro)
#### Post date: [March 25, 2015, 12:50am UTC](https://meta.discourse.org/t/custom-groups-field-is-blank/26730/2 "2015-03-25T00:50:57Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [March 25, 2015, 3:36pm UTC](https://meta.discourse.org/t/custom-groups-field-is-blank/26730/3 "2015-03-25T15:36:12Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 16, 2015, 12:49am UTC](https://meta.discourse.org/t/custom-groups-field-is-blank/26730/4 "2015-04-16T00:49:23Z")

</div>

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

[https://github.com/discourse/discourse/commit/4919ec4c44ab7f840aad891f1896fb7353fe8205](https://github.com/discourse/discourse/commit/4919ec4c44ab7f840aad891f1896fb7353fe8205)

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 16, 2015, 12:49am UTC](https://meta.discourse.org/t/custom-groups-field-is-blank/26730/5 "2015-04-16T00:49:26Z")

</div>


