I have found a weird little issue when trying to group some users in a course. There are multiple groups in the course and all seems well, but occasionally, for whatever reason, we end up with a user not in any group. That's simple enough to fix: find the group, add the user.
However it isn't quite as simple!
When I find the user and click on them to select and add to a group, Moodle helpfully tells me of the user's existing 'memberships'... see screen shot.
In the case here, the user is found as not in any group. When I go to group him I am told he has a membership to another group, except when I go to check that group he is not in it... and selecting him reveals yet another 'membership' to a further group... and yes, he's not a member of that one either! Selecting him there shows membership of the ORGINAL group...
So I am highly confused - I've no idea really why this is happening, only that it does. We auto-group our users from an external script, and we've worked through that line by line - it works 99% of the time and no errors in the code... but occasionally users fall into 'no group'.
Am I mis-reading the Moodle screen? Does 'membership' mean something entirely different... or is there a degree of random going on?