Implements recursiveSet for setting an orphaned menu item to the appropriate ancestor