User.module manually creates several form fields (on lines 1091 and 1664) rather than calling the form_ functions in common.inc. The fields on line 1664 are lacking a class attribute and all are missing id attributes, making their appearances difficult to control. It strikes me as better if the form_ functions were used, but I don't know enough about user.module to know if this is possible. At least the class and id info should be added manually.
Relevant code:
Line 1091
$group .= form_item(t('Password'), '<input type="password" class="form-password" name="edit[pass1]" size="12" maxlength="24" /> <input type="password" class="form-password" name="edit[pass2]" size="12" maxlength="24" />', t('Enter your new password twice if you want to change your current password, or leave it blank if you are happy with your current password.'), NULL, TRUE);
Line 1664
$rows[] = array('<input type="text" size="32" maxlength="64" name="edit[name]" />', '<input type="submit" name="op" value="'. t('Add role') .'" />');
Comment | File | Size | Author |
---|---|---|---|
#6 | hard.coded.form.fields_0.patch | 761 bytes | Robin Monks |
#5 | form_password_confirm.patch | 3.78 KB | Robin Monks |
#1 | hard.coded.form.fields.patch | 2.19 KB | Robin Monks |
Comments
Comment #1
Robin Monks CreditAttribution: Robin Monks commentedThis patch should take care of that. I was unable to get someone to review it, so it may have a rough spot.
Robin
Comment #2
Dries CreditAttribution: Dries commentedIMO, the usability of the forms degrades with this patch. It makes them look weird-ish.
Comment #3
Steven CreditAttribution: Steven commentedWe can use container-inline to put the two password boxes on one row, no?
Comment #4
Robin Monks CreditAttribution: Robin Monks commentedThat's a good thought, I'll try to make a patch with inline.
Robin
Comment #5
Robin Monks CreditAttribution: Robin Monks commentedHere is a much better way to approach confirm fields, via a new field type
form_password_confirm()
.I've tested this, and it works. It doesn't fix the second set of hard coded forms, I'll address them in a seporate patch.
Robin
Comment #6
Robin Monks CreditAttribution: Robin Monks commentedand for the second issue...
Comment #7
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedI like this approach, it removes hardcoded html form core modules. +1
Comment #8
moshe weitzman CreditAttribution: moshe weitzman commentedComment #9
(not verified) CreditAttribution: commented