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:

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.

CommentFileSizeAuthor
#6 menu_access-618828-6.patch637 bytesdjac

Comments

taran2l’s picture

Also you need to alter node edit form. Changes:

  if ($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);
  }
emptyvoid’s picture

Assigned: Unassigned » emptyvoid

Hmm do you have a patch I can apply and test against?

emptyvoid’s picture

Status: Active » Needs review

I am going to conduct testing on the current release and if the issue is confirmed review your change then test.

hydra’s picture

djac’s picture

Are there any updates with this issue?

It would be nice to get this issue sorted out, especially if the proposed solution above works. If I can help in any way, let me know.

djac’s picture

StatusFileSize
new637 bytes

I finally had some time to test Taran2l's code above, and it seems to work just fine when editing a node or editing a menu item.

Here's a patch that others can test with. If this does the trick, let's get it committed!

emptyvoid’s picture

thanks for the patch, as soon as I get my CVS account reactivated I will issue a new release to the dev branch for testing. I have several other patches and feature enhancement that I would like to roll into the next release.

emptyvoid’s picture

I have committed your patch to the dev branch, please download the test and let me know if it fixes the problem for you. I will roll this into the next release.

emptyvoid’s picture

Status: Needs review » Patch (to be ported)
djac’s picture

I just tested using the latest dev release and it fixes this issue.

djac’s picture

Status: Patch (to be ported) » Fixed

Fixed in 6.x-1.9.

Status: Fixed » Closed (fixed)

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