I fixed it

CommentFileSizeAuthor
show_menu_in_content_type.patch536 bytesbenys
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rv0’s picture

Status: Needs review » Postponed (maintainer needs more info)

I dont really understand what the original problem was.
Could you please explain it more?

TripleEmcoder’s picture

Status: Postponed (maintainer needs more info) » Needs review

An example setup involves a group type X and group content type Y. There is an y created in x and OG Menu Multiple in a sidebar (with no filtering). The menu shows correctly when viewing x, but disappears when going into y.

We believe that there is a bug in og_menu_block_view.

For group type X, this is called, which uses $group->gid (!= group nid):

elseif (og_is_group_type('node', $node->type)) {
  $group = og_get_group('node', $node->nid);
  $gids = array($group->gid);
}

For group content type Y, this is called, which uses $group->etid (== group nid):

if (og_is_group_content_type('node', $node->type)) {
  $nodegroups = og_load_multiple(og_get_entity_groups('node', $node));
  foreach ($nodegroups as $ng)
    $gids[] = $ng->etid;
}

And this always expect $gids to be, well, gids, not entity (node) ids:

$menus = og_menu_get_menus($gids);
rv0’s picture

Ah yes I see
This multiblock hadn't been tested yet
(hence the:

if ($delta == 'og_multi_menu_block') { // @todo Test this!!

in code)

Nice catch, will commit after testing

W.

rv0’s picture

Status: Needs review » Fixed

Committed the fix, thanks.

tbh, I don't think the multiblock feature is that useful, it needs some rethinking at least.

Status: Fixed » Closed (fixed)

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