Got these errors when clicking the Image galleries on the breadcrumb link

* warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid input syntax for integer: "" . in /includes/database.pgsql.inc on line 125.
* user warning: query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM drupal.node n INNER JOIN drupal.users u ON u.uid = n.uid INNER JOIN drupal.node_revisions r ON r.vid = n.vid WHERE n.nid = '' in /includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid input syntax for integer: "" . in /includes/database.pgsql.inc on line 125.
* user warning: query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM drupal.node n INNER JOIN drupal.users u ON u.uid = n.uid INNER JOIN drupal.node_revisions r ON r.vid = n.vid WHERE n.nid = '' in /includes/database.pgsql.inc on line 144.

Does anyone got the same problem? Know how to fix these problems?

CommentFileSizeAuthor
#7 image_133044.patch1.45 KBdrewish

Comments

drewish’s picture

Category: bug » support
Priority: Critical » Normal

i can't seem to find any queries in any of the image modules that looks like that. could you provide some more info? perhaps a link?

drewish’s picture

Status: Active » Postponed (maintainer needs more info)
herni7881’s picture

Choosing : Administer > Content Management > Image galleries ; will list all the galleries available.

Let say I choose Gallery A, it will list all images from Gallery A.
The breadcrumb showing : Home › Image galleries.
When clicking the 'Image galleries' link on the breadcrumb, the mentioned errors would occur.

Sorry cant provide any link. btw, sorry 4 the late reply

aacraig’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Active

I get the same warning:

    * warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid input syntax for integer: "" in /var/www/virtual/zonanordovest.fi.it/includes/database.pgsql.inc on line 125.
    * user warning: query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE n.nid = '' in /var/www/virtual/zonanordovest.fi.it/includes/database.pgsql.inc on line 144.
    * warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid input syntax for integer: "" in /var/www/virtual/zonanordovest.fi.it/includes/database.pgsql.inc on line 125.
    * user warning: query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE n.nid = '' in /var/www/virtual/zonanordovest.fi.it/includes/database.pgsql.inc on line 144.

I have tried a little to track down the offending bit, but am not familiar enough with the system to find it. It looks to me like it's trying to look up data for galleries with no images. In fact, if I remove all galleries with 0 images (either by deleting them or putting at least one image in them), the warning disappears.

fidot’s picture

In which case, my guess would be use of %s rather than %d for n.nid in the WHERE clause.

Please note that I haven't looked at the code - it's just seems likely to me.

Hope that helps someone track it down.

Terry

drewish’s picture

yeah, the %s shouldn't be used for the IN query... i'll have to look around and see what the correct way to do that is.

drewish’s picture

Status: Active » Needs review
StatusFileSize
new1.45 KB

here's a patch. please test it out.

drewish’s picture

Status: Needs review » Fixed

committed to HEAD and DRUPAL-5.

Anonymous’s picture

Status: Fixed » Closed (fixed)