Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I updated to 7.x - 1.3
When i go to the listing message page (/messages), i obtain a blank page with this issue:
Catchable fatal error: Object of class stdClass could not be converted to string in /usr/local/drupal/includes/theme.inc on line 2594
I rerolled back to 7.x-1.2 and apply each patch until i get this error.
Applying patch from http://drupal.org/node/1282108 make this error
theses two lines seems to be the cause:
$user_ids = privatemsg_user_load_multiple(array($uid));
if ((int)$uid > 0 && ($account = array_shift($user_ids))) {
Important notice: i use PostgreSQL 8
Comment | File | Size | Author |
---|---|---|---|
#8 | ensure_that_userid_is_integer-1714176-8.patch | 764 bytes | Jibus |
#2 | avoid_empty_uid-1714176-2.patch | 613 bytes | Jibus |
Comments
Comment #1
BerdirThanks for tracking this down.
You really want to learn about git bisect: http://www.palantir.net/blog/using-git-bisect-fun-and-profit. That makes a task like this much faster.
Comment #2
Jibus CreditAttribution: Jibus commentedHi Berdir,
Thanks for your answer ! I didn't know about bisect. As you say, it seems to be very helpful !
I tryed to look into this problem. I am not an expert, but below is what i found.
When i have Catchable fatal error, i did a "return browser" (sorry for my bad english). And this error appers:
PDOException: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "" LINE 4: WHERE (base.uid IN ('')) ^: SELECT base.uid AS uid, base.name AS name, base.pass AS pass, base.mail AS mail, base.theme AS theme, base.signature AS signature, base.signature_format AS signature_format, base.created AS created, base.access AS access, base.login AS login, base.status AS status, base.timezone AS timezone, base.language AS language, base.picture AS picture, base.init AS init, base.data AS data FROM {users} base WHERE (base.uid IN (:db_condition_placeholder_0)) ; Array ( [:db_condition_placeholder_0] => ) in DrupalDefaultEntityController->load() (line 196 of /usr/local/drupal/includes/entity.inc).
It seems that there is an empty value passed into a query which make PostgreSQL generate an error.
I looked into the foreach set line 86 in privatemsg.module:
I added a condition which verify that $uid is not empty
And it worked.
I made a patch (for 7.x-1.x) ... but in my opinion it resolves the issue, but it does not explain why $uid is sometimes empty (during the foreach).
I hope this will help in resolving this issue
Comment #3
Jibus CreditAttribution: Jibus commentedSorry to re-up this issue but at this time i cannot upgrade to the latest version of privatemsg.
Would be great if someone can just take a look at this =)
Thanks
Comment #4
Jibus CreditAttribution: Jibus commentedSince this is a minor modification and there is no feedback since almost two months, i set this to RTBC. Update the status, if you think this need more testing
Comment #5
Jibus CreditAttribution: Jibus commentedUpdate title, this is a PG issue
Comment #6
Jibus CreditAttribution: Jibus commentedAny update on this ?
Comment #7
ranvir.prasad CreditAttribution: ranvir.prasad commentedIn all queries in PostgreSQL, there should be check if any value being passed on as integer is actually integer, that can be checked with
where uid similar to '\d+'
Comment #8
Jibus CreditAttribution: Jibus commentedYes, it seems more appropriate than just verifiying if it's not empty.
Reroll patch against the current dev.
Patch should resolve also some problems on Oracle too. See https://drupal.org/node/1840428
Would be nice if some PG users can review this in order to make this module play nice with PG again :)
Comment #10
Jibus CreditAttribution: Jibus commented#8: ensure_that_userid_is_integer-1714176-8.patch queued for re-testing.
Comment #12
BerdirYou need to specify a dev version when uploading a patch. Patches are always applied against those.
Comment #13
Berdir#8: ensure_that_userid_is_integer-1714176-8.patch queued for re-testing.
Comment #14
Jibus CreditAttribution: Jibus commented5 weeks without any comment.
In my Drupal site, i didn't have any problem
Set this to RTBC.
Comment #15
Jibus CreditAttribution: Jibus commentedAny chance to get this commited ? :=)
Comment #16
BerdirCommitted and pushed to 7.x-1.x and 7.x-2.x.