CpNavService::modifyCpNav() makes the assumption that the handle of a navigation item is the same as its url in the cpnav_navigation table. This is true most of the time, but some plugins, like sprout-lists, allow the user to set a custom label for navigation items, which is causing subnav items to be missed and possibly other unpredictable behavior. cp-nav probably shouldn't be using the display label to look things up, which is supposed to be presentational. The url is more stable.
Steps to reproduce
Install sprout-lists
Change display name of sprout-lists under its settings
Confirm subnav items exist under Sprout Lists in the control panel
Install cp-nav
Subnav items are now missing under Sprout Lists
It does not happen when Sprout Lists is installed second because cp-nav picks up its default url and label.
Additional info
A fix might be to try to use the url first, not the label, to generate the handle and then fall back to the label instead of the other way around. Possible refactoring of CpNavService::regenerateNav() could be
Description
CpNavService::modifyCpNav() makes the assumption that the handle of a navigation item is the same as its url in the cpnav_navigation table. This is true most of the time, but some plugins, like sprout-lists, allow the user to set a custom label for navigation items, which is causing subnav items to be missed and possibly other unpredictable behavior. cp-nav probably shouldn't be using the display label to look things up, which is supposed to be presentational. The url is more stable.
Steps to reproduce
It does not happen when Sprout Lists is installed second because cp-nav picks up its default url and label.
Additional info
A fix might be to try to use the url first, not the label, to generate the handle and then fall back to the label instead of the other way around. Possible refactoring of CpNavService::regenerateNav() could be