Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webchick’s picture

Status: Active » Needs review
FileSize
1.88 KB

This is untested, but basically copy/paste/modify of http://api.drupal.org/api/function/menu_delete_menu_confirm_submit/6.

webchick’s picture

Oops. Noticed one typo already.

webchick’s picture

Now with fewer typos! This actually seems to work here. I'm not sure what this should be returning, though.

webchick’s picture

Status: Needs review » Needs work

Additionally, it probably makes sense to break this up into a install_menu_delete_menu_item function and call it from here.

webchick’s picture

Title: Add function for deleting menus » Add function for deleting menus and menu links

Well, interesting. So _menu_delete_link() does this totally bizarre behaviour of re-parenting children to where their parent was when it's deleted. So I think we need another function here, on the order of http://api.drupal.org/api/function/taxonomy_del_term/6, that goes through and recursively deletes all children menu links.

webchick’s picture

Status: Needs work » Needs review
FileSize
3.09 KB

Now with install_menu_remove_menu_link_recursive() :)

webchick’s picture

And now with matching cache clearage at the end.

q0rban’s picture

Nice!

I'm pretty sure the db_query_range() usage in install_menu_get_item() was already fixed here: #535822: install_menu_get_item() uses db_query_range instead of db_query