I am creating a 'useful-links' menu for my site. When I navigate to:

'admin/build/menu-customize/menu-useful-links/add'

I get the page for:

'admin/build/menu-customize/menu-useful-links/container-add'

I can add 'containers' but I can't add 'items'. When I disable the module the 'add-item' page returns and I can add items. When I added an item underneath a container (with the module still disabled) it worked perfectly and displayed in a block; but this would mean every time I wanted to add an item I would have to disable the module.

Comments

ajzz’s picture

Component: User interface » Code

Same problem after Jan 23rd upgrade! This is indeed critical bug and a problem with the code (changed from UI).

Roulion’s picture

Same here

mikeker’s picture

Looks like a logic error in _menu_item_container_form_menu_edit_item_alter(). As a quick fix you can change menu_item_container.admin.inc at line 88 from

  // We only need to alter the forms for menu item containers.
  if (isset($form['#parameters'][5]) && $form['#parameters'][5] != 'menu_item_container_edit' || isset($item['module']) && $item['module'] != 'menu_item_container') {
    return;
  }

to

  // We only need to alter the forms for menu item containers.
  if (!isset($form['#parameters'][5]) || ($form['#parameters'][5] != 'menu_item_container_edit') || (isset($item['module']) && $item['module'] != 'menu_item_container')) {
    return;
  }

I'll roll a proper patch later unless someone else beats me to it.

TonyBy’s picture

Thank you for your work on the new patch. I'm sorry to say that it has introduced a new problem:

When I add a menu item under a container item (which I could not do before the patch) the menu item is not accessible from the 'useful-links' menu in my block. A solid right arrow to the left of the container indicates that there are other items 'inside' the container but they cannot be accessed. When I disable the module I can access these items.

JohnAlbin’s picture

Title: Menu 'add item' page shows 'container-add' page » Menu "add item" page shows "add container" form
Status: Active » Fixed

the menu item is not accessible from the 'useful-links' menu in my block

Please open a separate support issue for that problem along with details about how that module provides that block and how it is configured. A normal core menu block should be working fine. Also, thanks for opening up this issue. :-)

Crap. I can see I was making sure the "edit item" page worked, but I didn't test the "add item" page when I committed that code. :-p

@mikeker your patch works great, but you don't need all those parenthesis.

Fixed. http://drupal.org/cvs?commit=495424

mikeker’s picture

your patch works great, but you don't need all those parenthesis

Yeah, I'm old school... *smirk*

I think it helps with readability, but perhaps that's because my editor does automatic parenthesis matching/pairing. To each his own, I suppose!

Thanks again for a great utility module.

Status: Fixed » Closed (fixed)

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