To recreate the bug:
1. create a course
2. add students and teacher to the course
3. create two orphaned groups
4. add students and teacher to groups
5. MAKE SURE to add at least one student to two group
6. create a chat, either in separate or visible group mode
7. login as the student belonging to at least two group.
8. enter the chat. No group drop down selection appears.
The same can be reproduced for teh Database module