I think the Organic Groups Mass Add documentation might be wrong (or simply confusing). It says it,
Takes a list where each row can be either:
username
mail address
firstname, lastname, mail address
firstname, lastname, mail address, desired username
The first line seems to suggest you can add new users with only a username and without an email address.
However, when trying to enter a username on its own, an error is thrown. The error, "Unknown format of userlist!" seems to come from the og_massadd_massadd_form_validate function (line 112 of the module) and the called function called from there _og_massadd_textareavalidate (line 120).
Email addresses are required by default in Drupal, so unless Organic Groups Mass Add works around that somehow, my guess is it's just the documentation that needs improving.
Comments
Comment #1
fuzzy76 commentedTerribly sorry for not getting back to you earlier, my email subscription on issues for this module was somehow lost. :(
Actually, a list of usernames without an email address should be allowed, but it would naturally require all users to exist already. But the list parsing as a whole is a bit buggy, and I haven't had time to fix it yet... :-/
Comment #2
nubeli commentedFor a client we tweaked the module in a few ways. To issues we worked on: make sure only legal usernames can be created. Ensure that existing users don't lose their first/last names when being added with bulk upload form.
In og_massadd.module I added this function to the end:
Then in the function _og_massadd_createusername wherever it is adding to the $usernames array I have it first clean the string so it will be a legal Drupal username. For instance, this:
becomes this:
Also I had the problem that it was blanking out the first and last names if a list of existing usernames is entered. That isn't expected behaviour since we're just trying to find existing users and add them to the group, not change their profiles. So I moved the closing bracket for this:
so that it's after this (to around line 376):
That way if the user already exists it won't bother trying to add the first and last names.
Just realized my notes above relate to the 7.x version so the line numbers and code might be different.
I think I'll post a patch in a new thread for all the changes (https://drupal.org/node/1993918). Sorry for not breaking them out but they're all small.
Comment #3
fuzzy76 commented