Posted by Taran2l on October 30, 2009 at 11:31am
| Project: | Menu Access |
| Version: | 6.x-1.8 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | emptyvoid |
| Status: | closed (fixed) |
Issue Summary
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.
Comments
#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?
#3
I am going to conduct testing on the current release and if the issue is confirmed review your change then test.
#4
#5
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.
#6
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!
#7
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.
#8
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.
#9
#10
I just tested using the latest dev release and it fixes this issue.
#11
Fixed in 6.x-1.9.
#12
Automatically closed -- issue fixed for 2 weeks with no activity.