Menu deletion doesn't work with sub_menu
Menu::Mapper.delete doesn't currently work for sub_menu items. I can remove items from :user_menu since that one doesn't use sub_menu, but when I try to remove menu items for nested entries in :top_menu in a plugin initializer, the menu item is not removed.
I have a fix which addresses this by modifying the .delete method. Instead of using find/delete on the top level node (which doesn't traverse children), the fix calls .each on the root node, which does traverse. I'm not sure if this fits with foreman coding/style guidelines, so if there's a better fix, feel free to replace my patch/PR with something different. This will need to be backported to 1.5-stable as well.
Proposed fix is at: https://github.com/theforeman/foreman/pull/1499