When i login this error show on my website:
PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: «uid2» LINE 2: WHERE (uid1 = 'uid2') AND (uid1 = '1') ^: DELETE FROM {drupalchat_msg} WHERE (uid1 = :db_condition_placeholder_0) AND (uid1 = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] => uid2 [:db_condition_placeholder_1] => 1 ) en drupalchat_user_login() (line 232 of /var/www/drupal-7.8/sites/all/modules/drupalchat/drupalchat.module).
I'm Using postgresql.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 1314644-drupalchat_user_login-postgresql.patch | 494 bytes | alphasupremicus |
| Pantallazo.png | 50.59 KB | rjulio |
Comments
Comment #1
rjulio commentedComment #2
alphasupremicus commentedYup - I get this same error using a PostgreSQL 9 backend and the beta0 drupal 7 module. I tracked it down to the ->condition('uid1', 'uid2') line of this function:
This can't be the right way to call this function as it get's turned into the following sort of SQL:
where uid1 = 'uid2' (notice that uid2 is a string literal and not the actual column named uid2).
So I dunno if this is PostgreSQL database driver nuance or what as that would be the wrong thing to do for any database platform, but the attached patch seems to at least generate what the author probably intended and no longer gives an error when logging in to the site. Basically the patch changes the ->condition('uid1', 'uid2') to ->where('uid1 = uid2').
Comment #3
rjulio commentedOo! it works. Thanks @alphasupremicus ;)
Comment #4
darklrd commentedCommitted - http://drupalcode.org/project/drupalchat.git/commit/d85d426. Thanks.