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();
Comments
Comment #1
kholloway commentedJust 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 (:
Comment #2
jgraham commentedAttached 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().
Comment #3
rv0 commentedCommited patch in #2
Sorry, forgot the proper git attribution strings.
Comment #4
azinck commentedThe 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.
Comment #5
rv0 commentednvm
Comment #6
rv0 commentedi closed wrong issue.
Comment #7
rv0 commentedupdate to latest dev.