While posting a comment, I get the same error reported here:

# warning: Invalid argument supplied for foreach() in /var/www/modules/node.module on line 359.
# warning: implode() [function.implode]: Bad arguments. in /var/www/modules/node.module on line 363.
# 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.moderate, 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 /var/www/includes/database.mysql.inc on line 120.

That bug report was dismissed with following rather remarkable "justification":

The other errors you posted are too low level for me to address - they aren't (necessarily) happening anywhere near my code.

I enclose a patch that solves the problem.

CommentFileSizeAuthor
subscriptions_5.patch875 bytesTBarregren

Comments

dziemecki’s picture

This error looks remarkably like this other one posted yesterday:

http://drupal.org/node/82623

Would you happen to be running PostGre?

TBarregren’s picture

No, I am not running PostgreSQL. And frankly, I don't think it's a database problem. I think you confuse an array with an object, as is evident from the submited patch. However, if it helps you, I am running MySQL 5.0.22 and PHP 5.1.2.

sanduhrs’s picture

I can confirm the error, using mysql.
Even though I don't think it has to do with the database.

The provided patch is working fine for me, all errors gone.

dziemecki’s picture

Are you using the the code I checked in 5 days ago? The patch above was implemented, in a manner of speaking. I was finding that the array notation broke some versions of PHP, and the object notation broke others. I hedged my bets by using something like this:

$nid = is_null($comment->nid) ? $comment['nid'] : $comment->nid;

sanduhrs’s picture

No, I didn't, sorry.
I just tried the new code and it's working well, thanks.

dziemecki’s picture

Assigned: Unassigned » dziemecki
Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)