The directions on the configuration form say to "Leave [Password Expiration Warning] blank to not send or display any warnings."

However, the code of password_policy.module assumes on line 382 that the warning field is a comma-separated list of numbers and then proceeds on line 384 to attempt to multiply the maximum value. Leaving the field blank as directed results in the error message, "Warning: A non-numeric value encountered in password_policy_user_login()" each time a user logs in.

Entering a 0 in this field gets rid of the error message and does not appear to cause any ill effects. I would recommend causing the form to default to a 0 value instead of a null string, and changing line 382 of the module file to default to a 0 value if the value is "".

Thank you!

Comments

BenStallings created an issue. See original summary.

aohrvetpv’s picture

Status: Active » Closed (duplicate)

This seems to be a duplicate of another recent bug report: #2942407: Add validation for expiration warning. Patch is there, but I can't get the tests to pass because of a bug with drupal.org.

I wonder why this issue is coming up now. Which PHP version are you using?

aohrvetpv’s picture

Actually the patch I posted there might not fix the problem as you describe it. I'll investigate and follow up in that issue.

I would still like to know which PHP version you're using! Thanks for the bug report.

aohrvetpv’s picture

BenStallings, this is actually already fixed in 7.x-1.x-dev, since August.

I'll probably do a new release soon since multiple people are running into this bug.

aohrvetpv’s picture