This isn't worth making a patchfile for. So I'll just type it here:

Original line 36 of the latest (June 29th, 2006) CVS release:

$node = node_load(arg(1));

This is attempting to pass a numeric variable to a function that is expecting an array.

$node = node_load(array('nid' => arg(1)));

The consequential error messages with the unmodified version are visible when going to view a comment on a forum:

warning: Invalid argument supplied for foreach() in /usr/local/www/data-dist/modules/node.module on line 359.
warning: implode() [function.implode]: Bad arguments. in /usr/local/www/data-dist/modules/node.module on line 364.
user error: 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.*, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid WHERE in /usr/local/www/data-dist/includes/database.mysql.inc on line 66.
warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/data-dist/modules/node.module:358) in /usr/local/www/data-dist/includes/common.inc on line 99.

Additionally I get an Access denied error at the bottom of the page where the content would be. Changing the line to the newer version eliminates the errors completely.

Cheers

Comments

gábor hojtsy’s picture

Status: Needs review » Closed (works as designed)

You should not be using 4.7, since this behaviour was changed in 4.7 so that node_load() caches the nodes only requested by nid. See http://drupal.org/node/22218#node_load