Currently on Drupal core 7.31, but this issue was first noticed and has persisted since 7.27. We're working with a custom theme that works with the prior version of Menu Block. Since upgrading to Menu Block 2.4, the theme breaks, and we're not certain why.

With Menu Block 2.3, this code in hook_preprocess_page() worked fine:

  if (module_exists('menu_block')) {
    $vars['main_menu'] = menu_tree_build(array(
      'delta'       => 'main_menu',
      'parent_mlid' => 0,
      'menu_name'   => 'main-menu',
      'title_link'  => FALSE,
      'level'       => 1,
      'follow'      => 0,
      'depth'       => 2,
      'expanded'    => TRUE,
      'sort'        => FALSE,
    ));
    // Remove the menu title
    unset($vars['main_menu']['subject_array']);
    $vars['user_menu'] = menu_tree_build(array(
      'delta'       => 'user_menu',
      'parent_mlid' => 0,
      'menu_name'   => 'user-menu',
      'title_link'  => FALSE,
      'level'       => 1,
      'follow'      => 0,
      'depth'       => 2,
      'expanded'    => TRUE,
      'sort'        => FALSE,
    ));
    // Remove the menu title
    unset($vars['user_menu']['subject_array']);
  }

After upgrade to Menu Block 2.4, this is all that is displayed on the page:

Fatal error: Only variables can be passed by reference in /var/www/html/sites/all/themes/custom/r2i_theme/template.php on line 82

This error refers to the first $vars['main_menu'] = menu_tree_build(array(...)); section. If I comment that out, then the error falls to the $vars['user_menu'] = menu_tree_build(array(...); section.

Comments

dasfuller’s picture

Issue summary: View changes