Problem/Motivation
Goodmorning, thanks so much for this module!
The actual implementation gives the possibility to a user to add a menu item by a select but there is not the possibility to limit menus.
If user has not permissions to see menu items the select will show anyway all menu name.
Steps to reproduce
1. add a field_menu to an entity;
2. add or edit the entity content and search to a menu item from select
You will see all project menu name.
Proposed resolution
It could be interesting add a checkboxes list of menus on field settings and select which one to show.
I will add a first patch to add this feature, any suggestions is good!
Thanks so much!
Comments
Comment #2
enrico.sato commentedComment #3
code-brighton commentedHi Enrico,
great! I'm glad the module is proving useful!
Ok so the field settings would let the admin restrict which menus are available in the select list for a particular field_menu field.
Sounds good. Feel free to submit a patch and I'll review :)
Comment #4
enrico.sato commentedHi Code, thanks so much for your reply!
Here a patch to add this feature. I tested also a scenario for an upgrade path and anything seems working well.
Let me know if anything is ok for you! Thanks!
Comment #5
mohit.bansal623 commentedHi Enrico.
Do you think checkboxes will be the solution, I think the design will not look good listing so many menus.
Comment #6
pierregermain commentedI have tested the patch, It's working.
Comment #8
code-brighton commentedThanks @enrico.sato I've tested the patch. Works well. I've committed to the dev branch
Comment #9
code-brighton commentedChanging status to needs review for now.
I'm happy with this and it's committed to the dev branch, but please feel free to give any feedback before I publish as a new release.
Comment #10
enrico.sato commentedHi @code-brighton and @pierregermain, sorry for delay and thanks too much for check!
@mohit.bansal623 I didn't think about this scenario, any suggestions about this?
Thanks!
Comment #11
code-brighton commentedHey @enrico.sato I was thinking it might be useful to have an option (checkbox?) to negate the condition so then you could e.g. exclude the Administration menu, which means menus added in the future would be included.
What do you think, do you want to add that functionality?
Comment #12
enrico.sato commentedHi @code-brighton, sorry for delay! Yeah, your idea is really good. I will create a new patch asap to add this news feature.
Thanks so much for your feedback!
Comment #13
code-brighton commented@enrico.sato I've added your work and the negate option and released in the new 2.0.0 version. Many thanks again for your contribution