Password and password confirmation are not marked as required fields on registration form if email verification is not required. I attached a patch to resolve this issue.

Comments

RobRoy’s picture

Status: Active » Closed (works as designed)

Except that these are not required in user/X/edit. Confirm password is only required if you put something in the first password box. I think...

ChrisKennedy’s picture

Status: Closed (works as designed) » Reviewed & tested by the community

mkalkbrenner is correct that the password file is required in certain cases, such as admin/user/user/create, but the current code does not properly allow this to be displayed. I noticed this tonight on the admin user page and came up with the exact same patch, which properly transfers the required property of the password form (whether it is set to TRUE or FALSE).

ChrisKennedy’s picture

"password file" -> "password field"

As long as I'm updating I'll also note that this is a simple port to d6 as well.

ChrisKennedy’s picture

Title: Password and confirmation not marked required » Password and confirmation cannot be marked required
StatusFileSize
new817 bytes

Here's the direct d6 patch.

RobRoy’s picture

Oops. I took a quick look at the patch and somehow thought it was doing a blanket set of #required => TRUE instead of passing the required value along in theme_password. You're right.

ChrisKennedy’s picture

Title: Password and confirmation cannot be marked required » Usability: Password+confirmation cannot be marked required

Bump - this is still RTBC unless someone has issues with it.

dries’s picture

This patch looks OK to me, although it would be comforting to get chx's or Eaton's "+1". :)

drewish’s picture

+1 works as advertised, all the patch changes is making it obvious that required fields are required.

ChrisKennedy’s picture

A similar fix for this issue was posted back in March, btw: http://drupal.org/node/126549

dries’s picture

Status: Reviewed & tested by the community » Needs work

Patch no longer applies against CVS HEAD. I'll go ahead and commit it, as soon it's re-rolled.

ChrisKennedy’s picture

Version: 5.1 » 6.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.53 KB

I thought about it some more and came up with a slightly more abstract patch. It combines the #size and #required pass-throughts into a more general foreach loop.

I also realized that a simple array_merge on pass1 and pass2 would allow forms to individually customize the form attributes for those elements. So with this patch you could specify a description or other custom attributes just for pass1 (or just for pass2), which wasn't possible previously.

ChrisKennedy’s picture

Buuump.

dries’s picture

Status: Needs review » Fixed

Chris, I liked the first patch better -- more transparent and easier to follow. I've re-rolled that patch and committed it to CVS HEAD. Thanks.

ChrisKennedy’s picture

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

Fair enough - it should be fixed in D5 too though.

drumm’s picture

Status: Reviewed & tested by the community » Needs work

The committed patch, http://cvs.drupal.org/viewcvs/drupal/drupal/includes/form.inc?r1=1.200&r..., does not apply to Drupal 5 CVS. It will need a reroll.

ChrisKennedy’s picture

Status: Needs work » Reviewed & tested by the community

You can use the patch in the original issue post - it's against D5 and is equivalent to what was committed.

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 5.

Anonymous’s picture

Status: Fixed » Closed (fixed)