A fresh installation of OG without any content types defined will yield this error message when loading ?q=og. This is on the CVS version of Drupal. A patch is forthcoming.
* warning: array_fill() [function.array-fill]: Number of elements must be positive in /Users/bonniebogle/Sites/newdrupal/includes/database.inc on line 235.
* warning: implode() [function.implode]: Invalid arguments passed in /Users/bonniebogle/Sites/newdrupal/includes/database.inc on line 235.
* 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 ')) AND (og.directory <> 0) ORDER BY node_created DESC ) AS count_alias' at line 13 query: SELECT COUNT(*) FROM (SELECT DISTINCT(node.nid) AS nid, node.title AS node_title, og.description AS og_description, users.name AS users_name, users.uid AS users_uid, (SELECT COUNT(n.nid) FROM node n INNER JOIN og_ancestry oga ON n.nid = oga.nid WHERE n.status = 1 AND oga.group_nid = og.nid) AS post_count, (SELECT COUNT(*) FROM og_uid ou INNER JOIN users u ON ou.uid = u.uid WHERE ou.nid = og.nid AND u.status > 0 AND ou.is_active >= 1 AND ou.is_admin >= 0 ) AS member_count, node.created AS node_created, og.selective AS og_selective FROM node node LEFT JOIN og og ON node.nid = og.nid INNER JOIN users users ON node.uid = users.uid WHERE (node.status <> 0) AND (node.type IN ()) AND (og.directory <> 0) ORDER BY node_created DESC ) AS count_alias in /Users/bonniebogle/Sites/newdrupal/sites/all/modules/views/includes/view.inc on line 652.
* 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 ')) AND (og.directory <> 0) ORDER BY node_created DESC LIMIT 0, 90' at line 13 query: SELECT DISTINCT(node.nid) AS nid, node.title AS node_title, og.description AS og_description, users.name AS users_name, users.uid AS users_uid, (SELECT COUNT(n.nid) FROM node n INNER JOIN og_ancestry oga ON n.nid = oga.nid WHERE n.status = 1 AND oga.group_nid = og.nid) AS post_count, (SELECT COUNT(*) FROM og_uid ou INNER JOIN users u ON ou.uid = u.uid WHERE ou.nid = og.nid AND u.status > 0 AND ou.is_active >= 1 AND ou.is_admin >= 0 ) AS member_count, node.created AS node_created, og.selective AS og_selective FROM node node LEFT JOIN og og ON node.nid = og.nid INNER JOIN users users ON node.uid = users.uid WHERE (node.status <> 0) AND (node.type IN ()) AND (og.directory <> 0) ORDER BY node_created DESC LIMIT 0, 90 in /Users/bonniebogle/Sites/newdrupal/sites/all/modules/views/includes/view.inc on line 677.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | og_sql_warn.patch | 2.09 KB | tmcw |
| #2 | group_types_sql.patch | 1009 bytes | tmcw |
Comments
Comment #1
moshe weitzman commented#278456: SQL errors in view.inc, and more, on displaing og homepage
Comment #2
tmcw commentedHere's a patch that only applies the WHERE IN statement in cases where group types are defined. If the desired behavior is for the query to return nothing, I can reroll it as a patch that adds a where clause of false.
Comment #3
tmcw commentedNever mind, then.
Comment #4
moshe weitzman commentedwell ok. yeah, lets have this return no nodes and add a drupal_set_message('Setup your friggin content types already', 'error'). we have a similar error in og_requirements() and in admin/settings/og
Comment #5
tmcw commentedHere's a new patch: it ensures that no nodes are returned, doesn't throw an error message, and sets a drupal_message identical to the one in og_requirements
Comment #6
moshe weitzman commentedcommitted. thanks for your quick turnaround time.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.