Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Similar to http://api.drupal.org/api/function/menu_delete/7.
Similar to http://api.drupal.org/api/function/menu_delete/7.
Comments
Comment #1
webchickThis is untested, but basically copy/paste/modify of http://api.drupal.org/api/function/menu_delete_menu_confirm_submit/6.
Comment #2
webchickOops. Noticed one typo already.
Comment #3
webchickNow with fewer typos! This actually seems to work here. I'm not sure what this should be returning, though.
Comment #4
webchickAdditionally, it probably makes sense to break this up into a install_menu_delete_menu_item function and call it from here.
Comment #5
webchickWell, 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.
Comment #6
webchickNow with install_menu_remove_menu_link_recursive() :)
Comment #7
webchickAnd now with matching cache clearage at the end.
Comment #8
q0rban CreditAttribution: q0rban commentedNice!
I'm pretty sure the
db_query_range()
usage ininstall_menu_get_item()
was already fixed here: #535822: install_menu_get_item() uses db_query_range instead of db_query