Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I get an notice after logging in:
Warning: A non-numeric value encountered in password_policy_user_login()
Comment | File | Size | Author |
---|---|---|---|
#7 | password_policy-7.x-1.x-validate_expiration_warning-2942407-7.patch | 1.26 KB | AohRveTPV |
| |||
#5 | password_policy-7.x-1.x-validate_expiration_warning-2942407-5.patch | 1.26 KB | AohRveTPV |
#2 | non-numeric value_2942407.diff | 718 bytes | immoreel |
Comments
Comment #2
immoreel CreditAttribution: immoreel as a volunteer commentedHere's a patch...
Comment #3
AohRveTPV CreditAttribution: AohRveTPV commentedThanks for the bug report and patch. This issue actually applies to 7.x-1.x, not 7.x-2.x.
Comment #4
AohRveTPV CreditAttribution: AohRveTPV commentedThis problem is due to an invalid value being entered for the "Password Expiration Warning" field in the Password Policy configuration.
The validation code needs some improvement to disallow more or all invalid values:
That regular expression would allow
,,,,
, for example, which is invalid.It would be better to fix it by disallowing invalid values instead of trying to cope with them by casting to int. I will attempt to improve the validation and share a patch. Thanks again for your bug report.
Comment #5
AohRveTPV CreditAttribution: AohRveTPV commentedComment #7
AohRveTPV CreditAttribution: AohRveTPV commentedComment #9
AohRveTPV CreditAttribution: AohRveTPV commentedReally strange to me that that patch doesn't apply in testing.
Comment #10
AohRveTPV CreditAttribution: AohRveTPV commentedimmoreel, this bug is actually fixed in 7.x-1.x-dev since August: #2895670: Errors re invalid number on PHP7+. I think you must actually be using 7.x-1.14.
Comment #11
AohRveTPV CreditAttribution: AohRveTPV commentedThe bug as reported is already fixed. Changing title of issue to reflect attempt to add validation for the field, to prevent some possible invalid values.
Comment #12
AohRveTPV CreditAttribution: AohRveTPV commentedTests are now passing thanks to a fix on the drupal.org end.
Comment #14
AohRveTPV CreditAttribution: AohRveTPV commentedI don't know why it just now submitted #2 for testing. #7 is the relevant patch here.
Comment #16
AohRveTPV CreditAttribution: AohRveTPV commented