Patch for "Invalid arguments...node.module on line 521" bug

fersman4 - May 18, 2008 - 23:52
Project:Node comments
Version:5.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

AttachmentSize
nodecomment.module.patch378 bytes

#1

sirkitree - May 19, 2008 - 18:23
Status:patch (code needs review)» fixed

Thanks. Committed.

#2

Anonymous (not verified) - June 2, 2008 - 18:32
Status:fixed» closed

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

#3

groberts100 - June 11, 2008 - 08:59

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.

#4

sirkitree - June 11, 2008 - 12:50

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.

 
 

Drupal is a registered trademark of Dries Buytaert.