Changing the "Menu depth" from the default of -1 causes an error box to overlay all pages (see screen snapshot attached). The error is "Notice: Undefined variable: parent_depth...".

Comments

add1sun’s picture

Status: Active » Fixed

Fixed this in HEAD.

Status: Fixed » Closed (fixed)

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

m4olivei’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev
StatusFileSize
new771 bytes

I get the same error when calling theme('nice_menus') from my theme's template.php:

function my_theme_preprocess_page(&$vars) {
  $vars['main_menu_links'] = theme('nice_menus', array(
    'id' => 1, 
    'menu_name' => 'main-menu', 
    'mlid' => null,
    'direction' => 'down', 
    'depth' => 2,
  ));
  if (!$vars['main_menu_links']) {
    $vars['main_menu_links'] = '';
  } else {
    $vars['main_menu_links'] = $vars['main_menu_links']['content']; 
  }
}

If I understand what's being done here, in theme_nice_menus_tree(), $parent_depth should be set to 0 when no mlid is passed to the function.

I've attached a patch against HEAD. This corrects the error.

Thanks,
Matt

add1sun’s picture

Status: Closed (fixed) » Needs review
FrequenceBanane’s picture

Status: Needs review » Closed (duplicate)

Same idea, and though duplicate of #1101722: Notice: Undefined variable: parent_depth line 399 of nice_menus.module which has been tested and reviewed