hello,
After installing 1.12 update, i cannot save user account anymore : I get a fatal error :
Sep 18 22:19:41 flurbiprofene EQUIDRUP: http://equidome.ddns.net|1442607581|php|192.168.0.1|http://equidome.ddns.net/?q=user/1274/edit|http://equidome.ddns.net/?q=user/1274/edit|1||PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "unblocked"#012LINE 4: ...'0') )OR( (unblocked IS NOT NULL ) AND (blocked > 'unblocked...#012 ^: SELECT ppe.pid AS pid#012FROM #012{password_policy_expiration} ppe#012WHERE (( (unblocked IS NULL ) AND (blocked <> :db_condition_placeholder_0) )OR( (unblocked IS NOT NULL ) AND (blocked > :db_condition_placeholder_1) ))AND (uid = :db_condition_placeholder_2) ; Array#012(#012 [:db_condition_placeholder_0] => 0#012 [:db_condition_placeholder_1] => unblocked#012 [:db_condition_placeholder_2] => 1274#012)#012 in _password_policy_was_user_blocked_due_to_expiration() (line 1424 of /home/oturpin/equidrup/sites/all/modules/password_policy/password_policy.module).
Using postgres database : postgresql-9.3 9.3.6-0ubuntu0.14.04
Thx for feedback
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | password_policy-7.x-1.x-fix_postgres_fatal_error_unblocking_user-2571139-4.patch | 533 bytes | aohrvetpv |
Comments
Comment #2
aohrvetpv commentedThe problem is this:
That was introduced in 7.x-1.12. I misused the API. The second parameter has to be a value, and cannot be a field. Maybe we can use
where().Comment #3
aohrvetpv commentedReproduced using PostgreSQL. Does not seem to occur with MySQL.
Comment #4
aohrvetpv commentedComment #5
aohrvetpv commentedPlease report whether the patch fixes the problem for you. I am planning to make another release in a week or so to include the fix. (Thinking we should wait a week in case any other major issues are reported.)
All automated tests pass on MySQL, PostgreSQL, and SQLite with that patch. I also did some ad hoc testing to make sure the logic of that database query was working as expected.
This was a failure in process: I should have run the automated tests on PostgreSQL and SQLite before releasing. Note also that this bug would have been caught by the new DrupalCI testing, had it yet been available for D7.
Comment #6
oturpin commentedHi AohRveTPV,
Patch seems to fail, at the time I set a new user account to active, meaning user was not blocked by expiration but just after creation before admin validation.
Here is the log:
Sep 20 21:36:39 flurbiprofene EQUIDRUP: http://equidome.ddns.net|1442777799|php|192.168.0.1|http://equidome.ddns.net/?q=user/1283/edit&destination=admin/people|http://equidome.ddns.net/?q=user/1283/edit&destination=admin/people|9||PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "unblocked"#012LINE 4: ...'0') )OR( (unblocked IS NOT NULL ) AND (blocked > 'unblocked...#012 ^: SELECT ppe.pid AS pid#012FROM #012{password_policy_expiration} ppe#012WHERE (( (unblocked IS NULL ) AND (blocked <> :db_condition_placeholder_0) )OR( (unblocked IS NOT NULL ) AND (blocked > :db_condition_placeholder_1) ))AND (uid = :db_condition_placeholder_2) ; Array#012(#012 [:db_condition_placeholder_0] => 0#012 [:db_condition_placeholder_1] => unblocked#012 [:db_condition_placeholder_2] => 1283#012)#012 in _password_policy_was_user_blocked_due_to_expiration() (line 1424 of /home/oturpin/equidrup/sites/all/modules/password_policy/password_policy.module).
Thx for your quick feedback !
Comment #7
aohrvetpv commentedI cannot reproduce that failure. Based on your output I suspect the patch was not applied successfully, or the change did not take effect.
Steps I tried:
1. Log in as an administrator.
2. Administration>Configuration>People: Who can register accounts?: Visitors, but administrator approval is required
3. Log out.
4. Follow "Create new account" link and register account with username "foo".
5. Log in as an administrator.
6. Browse to user edit page for "foo".
7. Change Status from Blocked to Active and press Save.
8. Observe "The changes have been saved." message.
Comment #8
oturpin commentedHi AohRveTPV,
MegaWoops ! You're right ! I did the change on the wrong machine... and did the test on another !
Fixed this. And result is OK. My test is exatcly what you listed.
Thx. Looking forward downloading the release ! Thx
Comment #10
aohrvetpv commentedThanks for testing the fix.
Comment #11
aohrvetpv commented