[drupal-devel] [bug] non-standard form fields

Robin Monks drupal-devel at drupal.org
Wed May 25 15:41:10 UTC 2005


Issue status update for http://drupal.org/node/23531

 Project:      Drupal
 Version:      cvs
 Component:    user.module
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Alex Reisner
 Updated by:   Robin Monks
 Status:       patch
 Attachment:   http://drupal.org/files/issues/hard.coded.form.fields_0.patch (761 bytes)

and for the second issue...




Robin Monks



Previous comments:
------------------------------------------------------------------------

May 24, 2005 - 17:40 : Alex Reisner

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') .'" />');




------------------------------------------------------------------------

May 24, 2005 - 18:12 : Robin Monks

Attachment: http://drupal.org/files/issues/hard.coded.form.fields.patch (2.19 KB)

This patch should take care of that.  I was unable to get someone to
review it, so it may have a rough spot.


Robin




------------------------------------------------------------------------

May 24, 2005 - 20:31 : Dries

IMO, the usability of the forms degrades with this patch.  It makes them
look weird-ish.




------------------------------------------------------------------------

May 25, 2005 - 04:20 : Steven

We can use container-inline to put the two password boxes on one row,
no?




------------------------------------------------------------------------

May 25, 2005 - 11:04 : Robin Monks

That's a good thought, I'll try to make a patch with inline.


Robin




------------------------------------------------------------------------

May 25, 2005 - 15:17 : Robin Monks

Attachment: http://drupal.org/files/issues/form_password_confirm.patch (3.78 KB)

Here 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







More information about the drupal-devel mailing list