Admin Menu Separator in first position is not displayed
Steps to Reproduce the Issue
- Create an admin menu, an admin menu Modul an place it on position Administrator Menu
- Create several admin menu items:
a,b,c,d,e,f. - Create separators:
s1,s2,s3. - Arrange the items and separators in the following order:
s1,a,b,s2,c,d,s3,e,f.
Expected Result
The menu items are displayed in the following order: s1, a, b, s2, c, d, s3, e, f.
Actual Result
The first separator (s1) is not displayed. The menu appears as: a, b, s2, c, d, s3, e, f.
System Information
j5.3 php 8.3
Additional Comments
If you use the separator item solely as a visual separator, the first separator at the top might not make sense (unless you place additional entries above the Custom Admin menu). However, if you use the 'Label' option, along with appropriate text for orientation, then a separator item at the top is quite useful.
Confirmed. When the separator is the first item it is not displayed. But then I guess that would be correct as it can not separate anything. "A separator with or without a text label, useful to separate items within a menu."
However I do agree with you that it would be useful to display
This is the code that is preventing the separator from being displayed. I do not understand the purpose of this code so am reluctant to touch it myself. Perhaps this information will assist someone else to resolve this issue
https://github.com/joomla/joomla-cms/blob/ee450c9193f5dd817a4d0897cd40d08828f7c14e/administrator/modules/mod_menu/src/Menu/CssMenu.php#L448-L458
I also note that if there is a separator at the end then it is displayed even though this code block suggests that it should not be
https://github.com/joomla/joomla-cms/blob/ee450c9193f5dd817a4d0897cd40d08828f7c14e/administrator/modules/mod_menu/src/Menu/CssMenu.php#L473-L478