To add a user to a group via the standard UI you sooner or later get to /admin/relations/add?group_id=1234&rel_type=membership_rel&party_id=2345
In most cases this works pretty fine and a new relationship is done. However, in some cases this does not work. Then the site will report an error like this:
'We had a problem processing your entry:
The party either does not exist or does not belong to this subsite.
Please back up using your browser, correct it, and
resubmit your entry.
Thank you.'
This happens with all users, that also do not get listed
on /admin/relations/add?group_id=3288&rel_type=membership_rel
Why certain users do not get listed here, I do not understand, since by the time I created those users via Login/Register only one subsite existed. The users I tried were all approved.
However, adding users to groups works ALWAYS, if you use direct PLSQL function SELECT membership_rel__new(:group_id, :party_id)
Hmm... seems I'm still a long way from understanding this part of the system.