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.

CommentFileSizeAuthor
#5 og_sql_warn.patch2.09 KBtmcw
#2 group_types_sql.patch1009 bytestmcw

Comments

moshe weitzman’s picture

tmcw’s picture

Status: Closed (duplicate) » Needs review
StatusFileSize
new1009 bytes

Here'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.

tmcw’s picture

Never mind, then.

moshe weitzman’s picture

Status: Needs review » Needs work

well 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

tmcw’s picture

StatusFileSize
new2.09 KB

Here'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

moshe weitzman’s picture

Status: Needs work » Fixed

committed. thanks for your quick turnaround time.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.