Bug #6091

Menu deletion doesn't work with sub_menu

Added by Scott Seago over 3 years ago. Updated over 3 years ago.

Status:Closed
Priority:Normal
Assigned To:Scott Seago
Category:Web Interface
Target version:Sprint 24
Difficulty: Bugzilla link:1105566
Found in release: Pull request:
Story points-
Velocity based estimate-
Release1.5.1Release relationshipAuto

Description

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

Associated revisions

Revision cd3baa12
Added by Scott Seago over 3 years ago

fixes #6091 - menu removal wasn't traversing menu hierarchy

Revision cfca4688
Added by Scott Seago over 3 years ago

fixes #6091 - menu removal wasn't traversing menu hierarchy

(cherry picked from commit cd3baa125283acf1d52daa2a51c8c2c1beb93397)

History

#1 Updated by Dominic Cleal over 3 years ago

  • Category set to Web Interface
  • Status changed from New to Ready For Testing
  • Assigned To set to Scott Seago
  • Target version set to Sprint 24

#2 Updated by Dominic Cleal over 3 years ago

  • Release set to 1.5.1

Or 1.5.2, depending on schedule etc.

#3 Updated by Dominic Cleal over 3 years ago

  • Bugzilla link set to https://bugzilla.redhat.com/show_bug.cgi?id=1105566

#4 Updated by Scott Seago over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF