No Code Attached Yet
avatar hytsch
hytsch
17 May 2025

Steps to Reproduce the Issue

  1. Create an admin menu, an admin menu Modul an place it on position Administrator Menu
  2. Create several admin menu items: a, b, c, d, e, f.
  3. Create separators: s1, s2, s3.
  4. 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.

avatar hytsch hytsch - open - 17 May 2025
avatar joomla-cms-bot joomla-cms-bot - change - 17 May 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 May 2025
avatar brianteeman
brianteeman - comment - 10 Jun 2025

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

avatar brianteeman
brianteeman - comment - 10 Jun 2025

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

// Remove repeated and edge positioned separators, It is important to put this check at the end of any logical filtering.
if ($item->type === 'separator') {
if ($noSeparator) {
$parent->removeChild($item);
continue;
}
$noSeparator = true;
} else {
$noSeparator = false;
}

avatar brianteeman
brianteeman - comment - 19 Jun 2025

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

// If last one was a separator remove it too.
$last = end($parent->getChildren());
if ($last && $last->type === 'separator' && $last->getSibling(false) && $last->getSibling(false)->type === 'separator') {
$parent->removeChild($last);
}

Add a Comment

Login with GitHub to post a comment