silverstripe/sapphire — pull request #1143 by svandragt (2013-01-29 15:35:38+00:00)
Title: Sort menu items according to priority descending, then title ascending

CMS menu items are currently sorted by priority, then first come first serve (index of the foreach loop). This has the unintended result that multiple Model Admins are sorted by filename rather than menu_title, when no priority is provided by default.

This pull request creates a fairer sort by sorting by priority, then menu_title. As other menu items had an identical priority to ModelAdmin items (0), I have changed the default priority for ModelAdmins to -0.5, so that they are grouped together without intermixing with system CMS menu items.