If I try to enforce a delay constraint, when a user tries to change their password, they receive the following error:
Fatal error: Call to a member function condition() on a non-object in /path/to/site/sites/all/modules/password_policy/constraints/constraint_delay.inc on line 34
Call Stack:
0.0001 650360 1. {main}() /path/to/site/index.php:0
0.2158 4607960 2. menu_execute_active_handler() /path/to/site/index.php:22
0.2207 4844584 3. call_user_func_array() /path/to/site/includes/menu.inc:501
0.2208 4845200 4. drupal_get_form() /path/to/site/includes/menu.inc:0
0.2208 4846600 5. drupal_build_form() /path/to/site/includes/form.inc:188
0.5276 5936184 6. drupal_process_form() /path/to/site/includes/form.inc:350
0.5453 6223240 7. drupal_validate_form() /path/to/site/includes/form.inc:819
0.5454 6224152 8. _form_validate() /path/to/site/includes/form.inc:1084
0.5594 6327264 9. form_execute_handlers() /path/to/site/includes/form.inc:1331
0.6819 7498344 10. password_policy_password_validate() /path/to/site/includes/form.inc:1390
0.6819 7498424 11. _password_policy_constraint_validate() /path/to/site/sites/all/modules/password_policy/password_policy.module:642
0.6820 7499608 12. call_user_func() /path/to/site/sites/all/modules/password_policy/password_policy.module:806
0.6820 7499680 13. password_policy_constraint_delay_validate() /path/to/site/sites/all/modules/password_policy/password_policy.module:0
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | password_policy-delay_constraint-1467184-2.patch | 3.85 KB | erikwebb |
| #1 | delay_constraint_test-1467184-1.patch | 3.18 KB | matt v. |
Comments
Comment #1
matt v. commentedIt turns out I should have done a more thorough review of the patch in #1364764: Delay constraint needs to be converted to D7 database api that ultimately got applied. This issue turns out to be a problem with the delay constraint patch that in my review didn't get triggered by the existing tests.
The earlier 1364764-delay-constraint-convert-to-dbtng-2.patch seems to fix the problem just fine.
I'm attaching a test file patch that illustrates the problem (borrowing heavily from the history constraint test). If you apply the attached test update, running the the tests before applying 1364764-delay-constraint-convert-to-dbtng-2.patch results in an error. After applying 1364764-delay-constraint-convert-to-dbtng-2.patch, all the tests pass.
Comment #2
erikwebb commentedAgreed. I'll roll back to that patch. Attached is the full patch including your test and the bug fix. Please test and confirm.
Comment #3
matt v. commentedI've tested again and confirmed that the patch in comment #2 above fixes the issue for me. I'm going ahead and marking it RTBC, but if you'd rather get confirmation from someone else, that's certainly understandable.
Comment #4
erikwebb commentedThis is a pretty big bug. I'll go ahead and push it out.
http://drupalcode.org/project/password_policy.git/commit/ead15e0