'Parent item' settings on 'admin/build/menu/item/%itemid/edit' shows ALL menus, not only user has access to
Taran2l - October 30, 2009 - 11:31
| Project: | Menu Access |
| Version: | 6.x-1.8 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | emptyvoid |
| Status: | active |
Jump to:
Description
If user has access to some menus - he must see only that menus in 'Parent item' setting. Now, user see ALL the menus available in Drupal.
Seems it fixes by this code:
<?php
function menu_access_form_alter(&$form, $form_state, $form_id) {
/* original part skipped */
if ($form_id == 'menu_edit_item') {
$item = $form['menu']['#item'];
$form['menu']['parent']['#options'] = menu_parent_options(menu_access_get_menus(), $item);
}
}
?>Please test it. Thank you.

#1
Also you need to alter node edit form. Changes:
<?phpif ($form_id == 'menu_edit_item' || isset($form['#node']) && $form['#node']->type .'_node_form' == $form_id) {
$item = $form['menu']['#item'];
$form['menu']['parent']['#options'] = menu_parent_options(menu_access_get_menus(), $item);
}
?>
#2
Hmm do you have a patch I can apply and test against?