When the checkbox beside a role on the administrator's User Create form is clicked, the whole form is automatically submitted by JavaScript. There is no warning or explanation given to the acting administrator, who doesn't even have a chance to fill in any subsequent fields on the form before completing it.

By the comment preceding the last line of code of the profile_role_form_user_register_alter() function, I understand in theory what the line's purpose is, but it just doesn't seem to work! At least not on my website - maybe there is a scenario in which it does. But in my opinion, it does not seem right that this form should be submitted just so that it can be properly reconstructed. The result of its submission is the creation of a user account that is incomplete (according to the acting administrator's wishes, who has no chance to fill out the "notify user" checkbox or any additional fields added beneath it by other modules), and rather than the form reappear with the new profile fields that could be filled out, a new empty Create User form appears in its place (since the previous form's workflow completed successfully).

It really seems like this line of code was never properly tested to me, unless there is indeed another scenario I can't think of in which it actually works as intended.

A preferred solution, in my mind, would be to load the missing Profile Category fieldset(s) via AJAX when those role checkboxes are checked. I'd love to figure out how to that for you, but I've never had any luck making my AJAX code work in Drupal. I think I still just haven't mastered the concept or something. Surely someone else here must be able to figure it out!

Comments

cindyr’s picture

For those of you who need this fixed immediately, the answer is found in this duplicate issue: http://drupal.org/node/716158