hello

i get this error-message here after posting a new cck-node:

* warning: Invalid argument supplied for foreach() in /xxx/modules/node/node.module on line 561.

* warning: implode() [function.implode]: Invalid arguments passed in /xxx/modules/node/node.module on line 565.

* 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 /xxx/includes/database.mysql.inc on line 172.

* warning: Invalid argument supplied for foreach() in /xxx/modules/node/node.module on line 561.

* warning: implode() [function.implode]: Invalid arguments passed in /xxx/modules/node/node.module on line 565.

* 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 /xxx/includes/database.mysql.inc on line 172.

* warning: Invalid argument supplied for foreach() in /xxx/modules/node/node.module on line 561.

* warning: implode() [function.implode]: Invalid arguments passed in /xxx/modules/node/node.module on line 565.

* 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 /xxx/includes/database.mysql.inc on line 172.

* warning: Invalid argument supplied for foreach() in /xxx/modules/node/node.module on line 561.

* warning: implode() [function.implode]: Invalid arguments passed in /xxx/modules/node/node.module on line 565.

* 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 /xxx/includes/database.mysql.inc on line 172.

does anybody knows this? or how to find the reason?

thanks and greetings momper

Comments

drew reece’s picture

I get this error too in sites updated to Drupal 5.9.

It starts with Invalid argument supplied for foreach() in /xxx/modules/node/node.module on line 561and goes on to reporting similar SQL errors on line 172 of /xxx/includes/database.mysql.inc

It happens on some of my remote servers and on my testing server (Mac, apache, php 5, mysql5).

Only just came across it the error, it seems to be related to posting cck types with link fields?

Can you post more info momper, what modules are you using, is it all up-to date? My sites have all been updated to 5.9 to get over another bug that was introduced in 5.8, UGH.

I'm planning on unpicking the files listed in the error message, but it will have to wait. I think it will be easier to roll back to a patched 5.8.

Maybe it's related to one of these ?

http://drupal.org/node/142286
http://drupal.org/node/282305

Drew

drew reece’s picture

Another post that seems to be having the same errors. It's not clear if it may be token module or link cck module

http://drupal.org/node/285293

D

mantyla’s picture

I checked the node.module line in question, and it is part of the node_load function. The invalid argument seems to be the $param argument to that function.

So you should disable your contrib modules one by one to isolate the one causing the problem, and then we can search its code for a node_load call with a bad parameter.

drew reece’s picture

Sounds like a plan for tomorrow,

I reverted Drupal back to 5.8 & left the modules in place (don'tcha love git), I still got the error on a node submission with a text field, an auto node title and a link field. I'm also using token, pathauto, transliteration and devel modules.

HTH,
Drew

drew reece’s picture

Turning off 'Allow user-entered tokens' for link paths for the link field seems to fix it :)

Really gotta go now,
Drew

SocialNicheGuru’s picture

i will check to see if this helps me.

http://SocialNicheGuru.com
Delivering inSITE(TM), we empower you to deliver the right product and the right message to the right NICHE at the right time across all product, marketing, and sales channels.

drew reece’s picture

My issue was due to the link module, you can apply the patch that is in post #11 in this thread http://drupal.org/node/285293

I did it manually because my site is on Drupal 5.9 not 6.3, I think I explained the way to do it in post #14 in the same thread.

Alternatively you can browse the alteration in the http://cvs.drupal.org contributions/modules/link repository.
Drew

momper’s picture

in my situation the solution from http://drupal.org/node/285293 worked ...

greetings momper

idflorin’s picture

Turning off 'Allow user-entered tokens' don't change anything for me

suit4’s picture

This kind of error seems to definitely related to invoking a node_load() with an empty node id.

I scanned my whole site for node_load() commands and found a faulty one in a custom template.

---8<--------------------------------
http://www.human-aspects.de

idflorin’s picture

I'll try this tomorrow and get back with the results
--------
blogger

thinguy’s picture

Working with
Node Hierarchy (5.x-1.x-dev and production)
Automatic Nodetitles (5.x-1.x-dev and production)
Drupal 5.11 (Have seen same error on 5.7 and 5.9)

Tracked my errors down to Node Hierarchy when working with Content types that aren't part of a Hierarchy. I just opened the issue below.

http://drupal.org/node/320108

My Error:

* warning: Invalid argument supplied for foreach() in C:\wamp\www\druptest\modules\node\node.module on line 561.
* warning: implode() [function.implode]: Invalid arguments passed in C:\wamp\www\druptest\modules\node\node.module on line 565.
* 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 C:\wamp\www\druptest\includes\database.mysql.inc on line 174.

Grimlock’s picture

If you're like me and you've customized a theme you might want to switch to another theme and try to reproduce the error. If the error is gone then you know it's in your theme some where.

Good luck.

thinguy’s picture

No code changes or customization

el_reverend’s picture

Hi all,

I just had the same problem with the Event and Link module. I followed two tips given here. One was to edit my content type fields (manage field) and disabled all fields that use token replacement (click configure in each field). My culprit was the link CCK type.

While that solved some of my issue it did not solve all problems. I edited the link.module (line 697) from this:

 $node = node_load($node->nid); // Necessary for nodes in views.

to this:

$node = $node; // Necessary for nodes in views.

I got the idea from here: http://drupal.org/node/142286 and take a look at comment number 8.

I am now trouble free from the preview bug. I hope this helps you as well. If someone would like to create a patch for these modules that would be greatly appreciated. How about fixing this issue even in the older 5.x versions?