Getting the following error message when editing a group content node.

Notice: Array to string conversion in DatabaseStatementBase->execute() (line 2136 of /Users/zipymonkey/Sites/acquia_d/includes/database/database.inc).

Looks like the array being returned by og_get_entity_groups() is not being dereferenced properly. Change at line 545 seems to fix this.

- $og_menus = db_query("SELECT menu_name FROM {og_menu} WHERE gid IN (:gids)", array(':gids' => $gids)->fetchCol();
+ $og_menus = db_query("SELECT menu_name FROM {og_menu} WHERE gid IN (:gids)", array(':gids' => array_values($gids['node'])))->fetchCol();

CommentFileSizeAuthor
#2 og_menu-1659296-2.patch3.59 KBjgraham
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kholloway’s picture

Just thought you'd like to know I added your patch to a patch file change I submitted (since after I applied my fix I needed to apply yours as well to get it to work without errors/notices):
http://drupal.org/node/1661534

Thanks (:

jgraham’s picture

Status: Active » Needs review
FileSize
3.59 KB

Attached patch addresses this issue and modifies all calls to og_get_entity_groups() to replace with a custom og_menu_get_node_groups() this way all usage is consistent and an array of gids is returned to the calling code or empty. This unifies the behavior across all calls to og_get_entity_groups().

rv0’s picture

Status: Needs review » Closed (fixed)

Commited patch in #2

Sorry, forgot the proper git attribution strings.

azinck’s picture

Status: Closed (fixed) » Needs work

The first line of og_menu_get_node_groups sets the $groups variable...the function subsequently references the variable as $nodegroups. $groups needs to be changed to $nodegroups.

rv0’s picture

Status: Needs work » Closed (fixed)

nvm

rv0’s picture

Status: Closed (fixed) » Needs work

i closed wrong issue.

rv0’s picture

Status: Needs work » Fixed

update to latest dev.

Status: Fixed » Closed (fixed)

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