If I upgrade Password Policy from 7.x-1.9 to 7.x-2.0-alpha3, then change a rule, I get a database error.

Steps:
1. Install and enable Password Policy module 7.x-1.9
2. Go to /admin/config/people/password_policy
3. Check Setting a default policy (passwords older than expiration time expire after setting the default policy, retroactive behaviour).
4. Check Expired accounts are not blocked. Users whose accounts have expired will be forced to change their passwords at next login.
5. Blank out the number of days for sending reminder e-mails.
6. Save configuration
7. Click Add tab
8. Policy name: test
9. Roles: Check authenticated user
10. Password Expiration: 1
11. Password Expiration warning: [leave blank]
12. Click Create
13. At /admin/config/people/password_policy/list, check Enabled
14. Click Save changes
15. Disable Password Policy module
16. Replace 7.x-1.9 code with 7.x-2.0-alpha3 code.
17. Run update.php procedure
18. Enable Password Policy module
19. Give Administrator permission to administer it
20. Go to /admin/config/people/password_policy
21. On the test row, click Edit.
22. Click Password Expiration to expand it
23. On expire limit, change 0 to 1 hour
23. On When to send warning emails, blank out the value
24. Click Save

Actual result: Log gets error: [with redactions]

Jan 6 00:47:49 [server] [environment]: [site URL]|1420505269|php|[IP]|[site URL]/admin/config/people/password_policy/list/test/edit|[site URL]/admin/config/people/password_policy/list/test/edit|193||PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'config' in 'field list': UPDATE {password_policy} SET config=:db_update_placeholder_0
WHERE (name = :db_condition_placeholder_0) ; Array
(
[:db_update_placeholder_0] => a:14:{s:10:"alpha_case";a:1:{s:10:"alpha_case";i:0;}s:10:"char_count";a:1:{s:10:"char_count";s:0:"";}s:11:"alpha_count";a:1:{s:11:"alpha_count";s:0:"";}s:5:"delay";a:1:{s:5:"delay";s:0:"";}s:15:"drupal_strength";a:1:{s:15:"drupal_strength";s:0:"";}s:9:"blacklist";a:1:{s:9:"blacklist";s:0:"";}s:12:"symbol_count";a:2:{s:12:"symbol_count";s:0:"";s:20:"symbol_count_symbols";s:30:"!@#$%^&*()_+=-|}{"?:><,./;'\[]";}s:8:"username";a:1:{s:8:"username";i:0;}s:14:"past_passwords";a:1:{s:14:"past_passwords";s:0:"";}s:11:"consecutive";a:1:{s:22:"consecutive_char_count";s:0:"";}s:9:"int_count";a:1:{s:9:"int_count";s:0:"";}s:7:"authmap";a:1:{s:11:"authmodules";a:0:{}}s:4:"role";a:1:{s:5:"roles";a:16:{i:1;i:0;i:2;i:0;i:4;i:0;i:6;i:0;i:11;i:0;i:26;i:0;i:5;i:0;i:3;i:0;i:7;i:0;i:36;i:0;i:41;i:0;i:46;i:0;i:51;i:0;i:56;i:0;i:71;i:0;i:66;i:0;}}s:6:"expire";a:5:{s:12:"expire_limit";s:6:"1 hour";s:22:"expire_warning_message";s:46:"Your Password has expired please change it now";s:25:"expire_warning_email_sent";s:0:"";s:28:"expire_warning_email_message";s:0:"";s:28:"expire_warning_email_subject";s:92:"[user:name] you password on [site:name] shall expire in [password_expiration_date:interval] ";}}
[:db_condition_placeholder_0] => test
)
in drupal_write_record() (line 7239 of [file path]/docroot/includes/common.inc). request_id="bc4c5b5c-0eca-4038-92ee-97080ffdc4f3"

Expected result: Redisplay page with no error, with a green-background message saying that my update was applied.

17. Go to /admin/config/people/password_policy/list/test/edit

Actual result:
Expire limit contains 0
E-mail warning date contains -14

Expected result:
Expire limit contains 1 day
E-mail warning date is blank

Comments

Charles Belov’s picture

Issue summary: View changes
AohRveTPV’s picture

Status: Active » Closed (duplicate)
Related issues: +#2027019: Upgrade from 7.x-1.x to 7.x-2.x not possible

This specific bug is part of the more general bug that there is no upgrade code for 7.x-1.x -> 7.x-2.x. I linked this issue to and from the issue for that more general bug. I suggest we keep only that bug open. Once it is fixed this issue should be fixed.

Agree with your priority of "Major". Changing #2027019: Upgrade from 7.x-1.x to 7.x-2.x not possible to Major.