How to reproduce:

1. Create a new content type with CCK
2. Add a Fivestar Rating field (Stars)
3. Create content with the new content type
4. Submit and appear the error:

* warning: Invalid argument supplied for foreach() in .../modules/node/node.module on line 504.
* warning: implode() [function.implode]: Bad arguments. in .../modules/node/node.module on line 508.
* 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 .../includes/database.mysql.inc on line 167.
* warning: Invalid argument supplied for foreach() in .../modules/node/node.module on line 504.
* warning: implode() [function.implode]: Bad arguments. in .../modules/node/node.module on line 508.
* 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 .../includes/database.mysql.inc on line 167.

The content is created but appear this warnings.

Comments

oriol_e9g’s picture

My system settings:

MySQL database 4.1.13
PHP 4.4.0

joemoraca’s picture

I have the exact same issue.. (create or edit CCK content type)

Drupal 5.0
CCK 5.x-1.2
Voting API 5.x-1.2
Fivestar 5.x-1.3 (and the previous release)

Mysqli -- 5.0.21
PHP 5.1.4

I turned on and off most CCK contrib modules and it seemed to narrow down to Fivestar / Voting API

# warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\drupal\modules\node\node.module on line 504.
# warning: implode() [function.implode]: Bad arguments. in C:\xampp\htdocs\drupal\modules\node\node.module on line 508.
# 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:\xampp\htdocs\drupal\includes\database.mysqli.inc on line 151.

rickvug’s picture

I can confirm as well using a fresh install. I have fivestar enabled the node for visitors and went to add a separate CCK field for an individual author rating. Even though this error appears everything seems to work fine and the error disappears after a simple page reload.

Here is my error message and some notes about my configuration:

Drupal 5.1
Voting API 1.2
Fivestar 1.3
CCK 1.3
Views 1.5 (enabled but not used)
Imagefield (enabled but not used)

MySQL database 4.1.21
PHP 4.4.4

    * warning: Invalid argument supplied for foreach() in /home/my_domain_dir/public_html/subdomain_dir/modules/node/node.module on line 504.
    * warning: implode() [function.implode]: Bad arguments. in /home/my_domain_dir/public_html/subdomain_dir/modules/node/node.module on line 508.
    * 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 /home/my_domain_dir/public_html/subdomain_dir/includes/database.mysql.inc on line 172.
vlooivlerke’s picture

I have the same problem. Also a fresh install.
Removing the Five Star CCK field is the only resolution? Dam it looked relay good.
My system settings:
Drupal 5.1
MySQL database 4.1.21
PHP 4.4.4
CCK 5.x-1.3
Voting API 5.x-1.2
Fivestar 5.x-1.3

joe4’s picture

Same problem new install.

meximese@drupal.org’s picture

I too have the same problem with FiveStar and CCK. Everything appears to work fine, but the above errors appear on submit. Have tried a Content Type with no other CCK contrib modules involved, ie. Title, Body and FiveStar, and it still doesn't work.

Drupal 5.1
Fivestar 5.x-1.3
Voting API 5.x-1.2
PHP 4.4.4
MySQL 4.1.21

Has there been any development on this issue?

newdru’s picture

Same Error for me too..

biohabit’s picture

Same here, is this module working for anyone?

quicksketch’s picture

Status: Active » Fixed

Sorry for the troubles all :(

I'm releasing 1.5 imminently which includes the fix in http://drupal.org/node/137887. Solving this problem. Thanks for the report.

killes@www.drop.org’s picture

Status: Fixed » Closed (fixed)