Hi,

When using node_load(array('nid'=>$node)) with a $node that does not exist in database, I've got the following error:

warning: sprintf(): Too few arguments in /var/www/drupal/includes/database.inc on line 154.

user error: Query was empty
query:  in /var/www/drupal/includes/database.mysql.inc on line 66.

As there is no test if the query has return a node or not.

A if($node) {} block should be added between lines 366 to 393 in node.module

Comments

chx’s picture

Status: Active » Closed (won't fix)

From your description it seems you are calling node_load with an object instead of an int.