Hi! I just enabled password_policy on an Ubercart 2.13-6.30 site. I didn't get any errors on the enable, but when I tried to force all users to change their password, I got this error:
Warning: array_fill(): Number of elements must be positive in db_placeholders() (line 276 of [path]/pressflow-6.30.1/includes/database.inc).
Warning: implode(): Invalid arguments passed in db_placeholders() (line 276 of [path]/pressflow-6.30.1/includes/database.inc).
User warning: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1 query: UPDATE password_policy_force_change SET force_change = 1 WHERE uid IN () in _db_query() (line 169 of [path]/pressflow-6.30.1/includes/database.mysqli.inc).
Looking again, I realized that one of the roles, "product_role", is provided by Ubercart, and this site does not actually have any users with that role.
So, I tried to force a password change again, using only those roles that have users. This did not throw an error.
But when I tried to force a password change only for "product_role" users, I got the error again.
So, I wonder if this is a general bug that occurs whenever a password change is forced on a role with no users. If so, it could probably be fixed with a quick check.
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | fix_force_password_change_error_for_roles_without_users-2241489-1.patch | 720 bytes | aohrvetpv |
Comments
Comment #1
aohrvetpv commentedYou did all but write the patch, thanks. Fixed problem in the same way as 7.x-1.x had already fixed it (added
!empty($uids)check).Comment #2
deekayen commentedComment #3
aohrvetpv commentedWas already fixed in 7.x-1.x. 7.x-2.x does not currently have "force password change" feature, so this issue does not apply to it.
Comment #4
aohrvetpv commentedWas committed on 6.x-1.x by deekayen. (Thanks.)
http://drupalcode.org/project/password_policy.git/commit/06574b5