kongondo / MenuBuilder

Easily create navigation lists/menus using drag and drop
GNU General Public License v2.0
21 stars 9 forks source link

HTML in menu items title is deleted when non-admin user make changes #39

Closed digitalbricks closed 5 years ago

digitalbricks commented 5 years ago

Using the latest version 0.2.5 i noticed the following issue:

When a non-admin user do changes to a menu (such as adding pages) with setting "Allow HTML in menu item titles" enabled, formerly present HTML in the menu title is cleared on safe.

So everytime a non-admin user did changes, i – as admin – have to redo the HTML in the menu item titles.

I think this is a problem with the permission, because a non-admin user isn't allowed to add HTML?

kongondo commented 5 years ago

Does your non-admin user have the permission menu-builder-markup? As stated in my response to issue #40 , you need to create these permissions and assign them to the user role.

I think this will resolve your issue. If so, please let me know and close the issue.

Thanks.

digitalbricks commented 5 years ago

Yes - this issue correlated with #40 and was solved by adding the menu-builder-markup permission manually and assigning it to the user role.

But, unless my personal issue is solved that way, couldn't there be a site where a non-admin role is intentionally not allowed to add HTML but may sort the menu items or add pages? So everytime such a non-admin user saves a changed menu, some properties (such as added HTML by an admin user, or a disbled menu item) get lost.

To be honest, I could not imagine a way to handle the HTML-part of this "issue" but at least the disabled-state should remain as it was set by the admin user (a disabled menu item keeps disabled – wich is not the case at the moment).

Again: Thank you very much!

kongondo commented 5 years ago

The allow HTML feature is a way to customise the menu to ones liking. However, it was added before Menu Builder got updated with a method to create custom menus with much more flexibility. This is the getMenuItems() method. Personally I encourage devs to use that method instead of Allow HTML. Have a look at the links in the getMenuItems() documentation. It might just be what you need.

digitalbricks commented 5 years ago

I read about the getMenuItems() method but in my (edge) case the default MenuBuilder fits 99.9% of my needs. The client only asked for a single icon in the title on one single menu item – so i accomplished that with HTML in that single menu item title.

But anyway – thanks for your help and this great (!) module. I love it!