SQL error for anonymous users on Views Nivo Slider block I have created a slideshow using the Views Nivo Slider module and added it as a block to the home page of my site (running Drupal 6). Everything works great, but for anonymous users I am getting 2 MySQL errors and the block does not display.

You can see the error message by going here: http://staging.thespanishacademy.com

Naturally, I suspect permissions issues but have triple checked everything, flushed all caches, rebuilt node permissions to no avail.

Any help would be appreciated. I'm also including the exact error message below for historical purposes.

warning: Invalid argument supplied for foreach() in /home/spanish/public_html/staging/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 924.

warning: Invalid argument supplied for foreach() in /home/spanish/public_html/staging/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1000.

warning: Invalid argument supplied for foreach() in /home/spanish/public_html/staging/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 924.

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 'FROM node node INNER JOIN node_access na ON na.nid = node.nid WHERE (na.grant' at line 2 query: db_query /* Anonymous : db_query / SELECT COUNT() FROM (SELECT DISTINCT FROM node node INNER JOIN node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'content_access_author') OR (na.gid = 1 AND na.realm = 'content_access_rid'))) AND ( (node.status = 1) AND (node.type in ('home_page_slideshow')) )) count_alias in /home/spanish/public_html/staging/sites/all/modules/views/plugins/views_plugin_pager.inc on line 141.

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 'FROM node node INNER JOIN node_access na ON na.nid = node.nid WHERE (na.grant' at line 2 query: db_query_range /* Anonymous : db_query_range */ SELECT DISTINCT FROM node node INNER JOIN node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'content_access_author') OR (na.gid = 1 AND na.realm = 'content_access_rid'))) AND ( (node.status = 1) AND (node.type in ('home_page_slideshow')) ) LIMIT 0, 5 in /home/spanish/public_html/staging/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1150.
When you enable content_permissions together with the rest of cck submodules, the fields you created aren't visible to anonymous users per default. Due to this, views doesn't add any columns to the select statement and you end up with a faulty select. So the solution is to either setup some permissions or switch content_permissions off.
In case you need to setup permissions on fields, i think Field Permissions is nicer - you can select the fields that will be affected, by default all is shown.