rev 1.83.2.22 has an important fix in it so that other modules' submit handlers that are added to the user_register form are not totally clobbered. Woohoo!

However, there remains one detail, which is kind of obtuse. I'll do my best to explain succinctly:

- Normally, without LoginToboggan, what happens with the registration form is user_register_submit() is called, then any functions that have been added to the form's #submit property. Thus under normal circumstances, any modules adding stuff to #submit on user_register can safely assume that the registration routines have happened and the user already exists in the database.
- However, the way LoginToboggan works is it unsets the user_register_submit() call altogether, in favour of its own. This by itself wouldn't be a problem, except that LoginToboggan starts with "L" and is weighted "0". Which means that any other contributed modules that start with A-L and try to add #submit handlers to this form, expecting the user to already exist when they do so, are in for a nasty surprise.

I ran into this issue with Bio module during development of the Allow CCK fields on the registration form feature.

There are two ways to fix this problem:
a) All contributed modules that start with the letter A-L and altering user_register's #submit property set their weight upon installation to 1 or something higher than LoginToboggan's default 0, on the off-chance their module is used on the same site as LoginToboggan.
b) LoginToboggan sets its weight on install to -1, so that it emulates user_register_submit(), and always comes before any other "normal" #submit handlers on the form.

My vote is for b), since LoginToboggan is the one doing something weird here. hunmonk disagreed on IRC, and asked me to make an issue for it when I could, so here it is. :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Status: Active » Needs review
FileSize
1.66 KB

And just in case, here's a patch. :)

hunmonk’s picture

FileSize
1.09 KB

i believe your proposed solution is a bit heavy-handed, and would prefer to be a bit more surgical about it. LT has other hooks where order matters (esp. hook_init), and moving it's weight now could have some unpleasant effects for people supposedly running a 'stable' release of the module.

let's try this approach instead, which handles this specific issue in a way i'm comforatble with, and doesn't mess with something as far-reaching as the overall module weight.

if this works out, we can forward port to 6.x

please test!

webchick’s picture

Status: Needs review » Reviewed & tested by the community

To test this, I moved LT's weight back to 0 again, applied the patch, and attempted the registration process. Bio's stuff kicked in, and the user was there when it did the query to grab the user ID.

So looks like it works, and is a much less heavier-handed solution. Thanks, hunmonk! :)

hunmonk’s picture

Version: 5.x-1.x-dev » 7.x-1.x-dev
Status: Reviewed & tested by the community » Fixed

fixed in both 5.x and 6.x -- thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.