Bug #6091

Menu deletion doesn't work with sub_menu

Added by Scott Seago about 4 years ago. Updated 8 days ago.

Status:Closed
Priority:Normal
Assignee:Scott Seago
Category:Web Interface
Target version:1.5.1
Difficulty: Team Backlog:
Triaged: Fixed in Releases:
Bugzilla link:1105566 Found in Releases:
Pull request:

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 about 4 years ago

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

Revision cfca4688
Added by Scott Seago about 4 years ago

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

(cherry picked from commit cd3baa125283acf1d52daa2a51c8c2c1beb93397)

History

#1 Updated by Dominic Cleal about 4 years ago

  • Category set to Web Interface
  • Status changed from New to Ready For Testing
  • Assignee set to Scott Seago
  • Target version set to 1.8.2

#2 Updated by Dominic Cleal about 4 years ago

  • Legacy Backlogs Release (now unused) set to 16

Or 1.5.2, depending on schedule etc.

#3 Updated by Dominic Cleal about 4 years ago

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

#4 Updated by Scott Seago about 4 years ago

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

Also available in: Atom PDF