When a user creates a content type that has an imagefield field, these warnings are appearing when the system goes to display the new node:
warning: Invalid argument supplied for foreach() in /var/www/html/modules/node/node.module on line 561.
warning: implode() [function.implode]: Bad arguments. in /var/www/html/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 /var/www/html/includes/database.mysql.inc on line 174.
I went to investigate the origin of these warnings but I couldn't find it. I've monitored then node_load (since that warning indicated lines are from there) and found that in one of the times when the function is called, between submit and redirect to view node, the nid $param is passed as integer, while node_load doesn't have conditions to test it as it is passed (only as array or numeric string).
I did the test deleting the imagefield from the content type (in the truth, I deleted every field, one by time), and it just happens when the imagefield field is configured.
Apparently this warnings doesn't affect node saving and viewing, and it also does not affect when editing nodes.
I'm using CCK 1.9, Drupal 5.11, my directory Files is public.
Comments
Comment #1
Vuds commentedAlso, there is some empty $param being called, I have just capture that in the node_load function... I'm starting thinking it is more possibly with this, than with the int passed...
Comment #2
hydrian commentedI get the same error in slightly different circumstances. I get it when I try to attach each image to a new node that is going to be created on the submit.
I am using D5.12, CCK 1.9, and ImageField 2.1. I am using a private filesystem.
Comment #3
quicksketchPlease try out the 2.6 version and reopen if this is still a problem. I'm closing after lack of activity.
Comment #4
wavesailor commentedHi,
Hopefully this can help as I encounter the same problem running all the latest 5.X code. I'm using Imagefield 5.x-2.6. This is the error I get
Invalid argument supplied for foreach() in /var/www/drupal_mother_5/sites/all/modules/imagefield/imagefield.module on line 859.
What I have discovered is that this Only happens when I enable the Transliteration (http://drupal.org/project/transliteration) module which is now apparently required by the ImageCache (http://drupal.org/project/imagecache) module.
Regards,
JJ
Comment #5
quicksketchClosing out Drupal 5 issues.