When I visit /node/12345/view, I get three errors/warnings:

    * warning: Invalid argument supplied for foreach() in /home/clients/websites/w_php0/public_html/php0/modules/node/node.module on line 521.
    * warning: implode() [function.implode]: Bad arguments. in /home/clients/websites/w_php0/public_html/php0/modules/node/node.module on line 525.
    * user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 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 in /home/clients/websites/w_php0/public_html/php0/includes/database.mysql.inc on line 172.

I tracked it down to line 643 (inside nodecomment_render). Apparently, it thinks $cid = 'view'. So the patch slightly changes the if statement.

This work was sponsored by Initsoft, LLC.

CommentFileSizeAuthor
nodecomment.module.patch378 bytesfersman4

Comments

sirkitree’s picture

Status: Needs review » Fixed

Thanks. Committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

groberts100’s picture

I've got exactly this error but do not have a file called nodecomment.module anywhere in my Drupal 5.5 installation.

So there is nothing to patch ! What to do ?

Thanks.

sirkitree’s picture

groberts100: note that the error is actually coming from node.module. This error occurs when a module tries to do a node_load() on a variable that is not a valid node id. So there is somewhere else in your installation that is passing a bad node id to this function. Look up debug_backtrace() and use this to see if you can pinpoint where this is happening.