Hi,

Thanks for putting in the work on this module. Very useful.

Just wanted to point out one thing: the module lets you set the character length of the machine name of the cloned menu to be longer than the limit of characters. Then, when you try to do anything, including changing the menu title or deleting the menu, you get the error:

The menu name can't be longer than 27 characters.

So now I'm stuck with some menus I don't want unless I go in through the database.

I hope that helps.

Comments

malc0mn’s picture

Assigned: Unassigned » malc0mn

looking into this now...

malc0mn’s picture

Status: Active » Fixed

The problem was, as usual, quite silly:

  <?php
  $form['menu_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Menu name'),
    '#default_value' => $menu['menu_name'],
    '#maxlength' => MENU_MAX_MENU_NAME_LENGTH_UI,
    '#description' => t('The machine-readable name of this menu. This text will be used for constructing the URL of the <em>menu overview</em> page for this menu. This name must contain only lowercase letters, numbers, and hyphens, and must be unique.'),
    '#required' => TRUE,
  );
  ?>

On submit the menu name is prefixed with 'menu-', so the correct code should be:

  $form['menu_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Menu name'),
    '#default_value' => $menu['menu_name'],
    '#maxlength' => MENU_MAX_MENU_NAME_LENGTH_UI  - strlen('menu-'),
    '#description' => t('The machine-readable name of this menu. This text will be used for constructing the URL of the <em>menu overview</em> page for this menu. This name must contain only lowercase letters, numbers, and hyphens, and must be unique.'),
    '#required' => TRUE,
  );
  

The issue was fixed and added to the new b4 release.

malc0mn’s picture

Ah rats, noooo... Forgot to commit it to beta4 :-(

Added this one to beta5, sorry for that.

druojajay’s picture

Thanks for your work on this!

malc0mn’s picture

You're welcome.

Status: Fixed » Closed (fixed)

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