Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Sort menus in the backend menu alphabetically #5683
This PR sorts the menutypes in the backend in alphabetical order and not in order how they were first created some ancient time ago.
How to test
@test Success. Works now without PHP warnings after correction.
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5683.
Not sure I like this one. In my multilingual test site, the menus which were created one language after the other are now disordered.
Also, the sorting done in this PR is different in mod_menu vs the dropdown in "Menu Manager: Menu items"
If it was decided to alpha sort the menus, the second solution is much better imho
can be used instead, to solve at least the case sensitive issue (IF we sort alpha)
we would get
changing locale to false has apparently no effect here.
I've changed the sorting to be case-insensitive and added the change to Hathor, too. I also first thought I enabled the local-aware sorting, but then noticed that that feature is actually implemented pretty stupidly... I would have to hand in the locale by which to sort and not simply true or false and quite frankly, the amount of code that would have to be written to do this properly is simply not worth the gain we maybe would get. As far as I can see, it would only make sure that letters like o and ö would be grouped next to each other in German for example. However, I think that it already orders via UTF8 and I guess that that takes care of this already anyway... Mind you, that is not based on hard facts, but a hunch.
In any case, I guess this is now ready for final testing/merging, depending on if this is actually a wanted feature. However, if we don't do this, we should remove the ordering in the menu manager filter dropdown to keep this consistent.