Repeatable: Always

Steps to repeat:

  1. Create and enable a password policy and enable the username constraint
  2. Go to the registration form and fill out the form but leave the username empty

Expected result:
Message saying the username field is required, without a warning.

Actual result:
Username field is required.
Warning: strpos(): Empty needle in password_policy_constraint_username_validate() (line 31 of /sites/all/modules/password_policy/constraints/constraint_username.inc).

OS: CentOS 6
Apache: 2.2.27
PHP: 5.4.27
Drupal: 7.31

CommentFileSizeAuthor
constraint_username.inc_.patch692 bytesvincent.verbruggen

Comments

aohrvetpv’s picture

Thanks for the report and patch. I separated the check for empty username because I wanted to make it explicit why we are doing that. Please follow up if there is any problem with the adjusted patch.

aohrvetpv’s picture

Status: Active » Fixed

Looks like neither 7.x-2.x nor 6.x-1.x have this bug.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.