If you have the following:
- LoginToboggan enabled
- Profile module enabled
- At least one profile field set to show on registration form
- LoginToboggan set to show both a e-mail address confirmation field and the password fields on the registration form
The result is that instead of the form fields looking like:
username
email
confirm email
password
confirm password
they now become:
username
email
password
confirm email
confirm password
which is of course highly confusing. :P
I spent the better part of an hour trying to figure out the "root" of why it does this and failed... in the end though this simple patch to just increase the weight of the password fields seems to fix the problem just fine.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | logintoboggan.module_12.patch | 983 bytes | webchick |
| #5 | logintoboggan.module_11.patch | 969 bytes | webchick |
| #2 | logintoboggan.module_10.patch | 1.06 KB | webchick |
| logintoboggan.module_9.patch | 1.03 KB | webchick |
Comments
Comment #1
webchickBah, no. :P That's cheesy and it also doesn't work. :P
Comment #2
webchickActually no. I don't see another way to fix this other than hard-coding the field weights. I threw a print_r($form) on line 186 of logintoboggan.module (at the end of the user_register form ID check).
Here's the output with no extra things on the registration form:
Then here's the output when there's stuff added:
I have NO idea why it's doing this! LT has the following code which allows for this test case and is putting the fields in the correct order:
(my print_r is right after this block -- there's nothing else that can be interfering)
So unless anyone has any better ideas, I'm going with the weight fix. :P This patch is a bit more robust than my other one, in that it should ensure these fields show up in order, regardless of other modules that may be injecting fields into this form in their own hook_form_alters. It's still kind of a cheesy fix, but I honestly don't know what else to do.
Comment #3
webchickComment #4
webchickNearing the point of wanting to scream now. ;) So that patch fixes it on my localhost running PHP 5 but not on my work server running PHP 4. *sigh* Will see what else I can come up with...
Comment #5
webchickOKAY. hehe. Let's try this. Seems to work in both places, and no cheesy weight crap. No idea why the "normal" way won't work, but whatever.
Comment #6
webchickNooooooooooooooooooooooooooooooooooooo!
Now the ressinfressin validation doesn't pass. :(
Comment #7
webchickMust be another blankety-blanking difference between PHP 5 and PHP 4... PHP 5 correctly inserts $form['account']['mail_conf'], etc. PHP 4 inserts it as $form['account'][0]. SIGH. >:\
Comment #8
webchickOk, I officially give up. Here's a weight patch I tested and works on both servers. Maybe someone smarter than me can come in and figure out what I'm overlooking later, but for now this works.
Comment #9
webchickComment #10
hunmonk commentedphew. tough problem. turns out that when the account fieldset is used, even for a non-admin registration, there's a form field 'pass' that's set to null, so LT isn't actually inserting it's pass field fresh, but overwriting the already existing one, which results in the wacky ordering. i patched 4.7 and HEAD to specifically unset the account pass form field in this case, which corrects the problem...
Comment #11
desm0n commentedDid you say CVS and 4.7 was patched for this ? As i just downloaded both, overwritten the files and this problem still shows for me. Is there anything else i need to do to update ?
Comment #12
hunmonk commentedi tested the fix against latest HEAD on my local server, and it worked just fine. are you sure you have the latest files from CVS? if you downloaded the tarballs they are probably not the most current--they tend to lag a day or so behind...
Comment #13
desm0n commentedAh i've never understood HEAD till today :) So i browse to the CVS http://cvs.drupal.org/viewcvs/drupal/contributions/modules/logintoboggan... and just download logintoboggan.module right ?
I always thought HEAD was the CVS tarball. See you live and learn :)
Comment #14
hunmonk commentedi would read this: http://drupal.org/repos
and try to get a CVS installation working for yourself. you'll find it indispensable once you have it working... :)
Comment #15
(not verified) commented