On the user registration form, the username and email fields are enclosed in a fieldset. If there are no other elements in the form, the fieldset border is hidden in order to make the form appear less crowded.
This feature broke and was fixed in #460706: Layout of registration form depends on timezone setting (see the screenshot from that issue).
But now it is broken again. This time it is due to #118345: Revamp hook_user_form/_register/_validate/_submit/_insert/_update that introduced some fields that are hidden using $element[#access] = FALSE
, e.g. $form['signature_settings']
.
This patch tries to fix it again. The clean-up is now done in user_register_form_pre_render(). This is really a generic function and could perhaps be moved to form.inc, but for now I have just added it to user.module.
Comment | File | Size | Author |
---|---|---|---|
#19 | 637712-user-register-form-fieldset_0.patch | 26.7 KB | webchick |
#16 | 637712-user-register-form-fieldset.patch | 5.19 KB | Dave Reid |
#15 | 637712-user-register-form-fieldset.patch | 5.12 KB | Dave Reid |
#6 | user-register-form-fieldset-3.patch | 5.41 KB | c960657 |
#5 | user-register-form-fieldset-2.patch | 5.38 KB | c960657 |
Comments
Comment #1
c960657 CreditAttribution: c960657 commentedComment #2
Bojhan CreditAttribution: Bojhan commentedO jeez, lol Nice catch.
ohh, and Hey c960657 :)
Comment #3
Bojhan CreditAttribution: Bojhan commentedJeez it was green, just not showing green
Comment #4
chx CreditAttribution: chx commented+ if ($visible_children == array('account', 'submit')) { this will break,
php -r "var_dump(array('foo', 'bar') == array('bar', 'foo'));"
gives me FALSE. Add a sort or array_diff and check for empty.Comment #5
c960657 CreditAttribution: c960657 commentedDone.
Comment #6
c960657 CreditAttribution: c960657 commentedReroll.
Comment #12
Bojhan CreditAttribution: Bojhan commentedWorks
Comment #13
webchickThis code makes baby kittens cry. :(
Let's please at least get some inline comments in there to explain what's happening. But it'd be lovely for sun, chx, effulgentsia or one of our other FAPI gurus to give this a once-over and see if there's a more elegant/readable way to do it.
Comment #14
Dave ReidCan we please, please extract this into a element_get_visible_children() function in form.inc?
Please add inline comments for the tests.
I'm on crack. Are you, too?
Comment #15
Dave ReidComment #16
Dave ReidFixed minor grammar errors in comments.
Comment #17
atheneus CreditAttribution: atheneus commentedLast submitted patch passed test.
Comment #18
Bojhan CreditAttribution: Bojhan commentedRTBC?
Comment #19
webchickGreat, this is much easier on the eyes now.
I just want to try this once more with one small adjustment:
to:
The latter is more consistent with what we do elsewhere in core.
Comment #20
webchickOk, cool. Committed #19 to HEAD!