It would be useful if the function menu_edit_item_form_submit
sets the mid, so you can use it in form_alter hooks when you save a
new menu or menu item. Otherwise this value is available only on update
but not in insert.

It should become :

function menu_edit_item_form_submit($form_id, &$form_values) {
$form_values['mid']=menu_edit_item_save($form_values);
return 'admin/build/menu';
}

Comments

tstoeckler’s picture

Title: menu_edit_item_form_submit mid doesn't set the mid back » menu_edit_item_submit() mid doesn't set the mlid for new items
Version: 5.0-rc1 » 8.x-dev

This is still valid in Drupal 8. The mlid is set in menu_edit_item() but is set to 0 by default for new menu links. On submit this value is not updated.
I don't really understand the use-case, though. Basically right after leaving this function, the whole form is meaningless.

tstoeckler’s picture

Version: 8.x-dev » 5.0-rc1
Status: Active » Closed (works as designed)

Actually I am going to close this issue. If the issue, whatever it may be, persists, please reopen and explain in detail.