Menus > Manage
.Administrator
to create a backend menu.New
.Title
and Alias
.Import a preset
: Select Preset Alternative Main Menu
.Save & Close
or just Save
Menu was saved but failed to import the preset: The alias 1627514907-04 is already being used by - menu item in the asdfgh menu (remember it may be a trashed item).
(asdfgh
is the alias/menutype I entered in this case).
The image shows several tests that resulted in different numbers of menu items but the last one (red arrow) where I have manipulated tha alias creation in MenusHelper.php
for separator
types before.
I located the error here: https://github.com/joomla/joomla-cms/blob/4.0.0-rc5/administrator/components/com_menus/src/Helper/MenusHelper.php#L509
Looks like microtime(true) is not reliable enough in faster environments to create unique aliases.
My temporary but bad (also a bit lottery ?) fix is
$item->alias = microtime(true) . '-' . uniqid();
-It is normal that in each additional menu with preset altenate.xml 1 more menu entry is added, but only 1.
Labels |
Added:
?
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-07-29 13:59:22 |
Closed_By | ⇒ | ReLater |
See pr #34974