No Code Attached Yet bug
avatar brianteeman
brianteeman
14 Mar 2022

Imported menu preset is not the same as the menu that was exported

Steps to reproduce the issue

Create a new admin menu with at least one heading and one child menu item
Export the menu as a preset
Delete the menu
Copy the downloaded xml file to administrator\components\com_menus\presets
Create a new admin menu and select the previously uploaded preset

Expected result

Menu created exactly as defined at the beginning

Actual result

All menu items are at the same level

Additional comments

This works in J3 where the xml produced is

<?xml version="1.0"?>
<menu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:joomla.org" xsi:schemaLocation="urn:joomla.org menu.xsd">
  <menuitem type="heading" title="heading" link="#" class=" " access="1">
    <params>{"menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_image_css":"","menu_text":1,"menu_show":1}</params>
    <menuitem type="component" title="child" link="index.php?option=com_content&amp;view=article&amp;layout=edit&amp;id=0" element="com_content" class=" " access="1">
      <params>{"menu-anchor_title":"","menu-anchor_css":"","menu_image":"","menu_image_css":"","menu_text":1,"menu_show":1}</params>
    </menuitem>
  </menuitem>
</menu>

Bit in J4 the xml is

<?xml version="1.0" encoding="UTF-8"?>
<menu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:joomla.org" xsi:schemaLocation="urn:joomla.org menu.xsd">
  <menuitem type="heading" title="test admin" link="#" class=" " access="1">
    <params>{"menu-anchor_title":"","menu_icon":"","menu_image":"","menu_image_css":"","menu_text":1,"menu_show":1,"dashboard":""}</params>
  </menuitem>
  <menuitem type="component" title="create article" link="index.php?option=com_content&amp;view=article&amp;layout=edit&amp;id=0" element="com_content" class=" " access="1">
    <params>{"menu-anchor_title":"","menu_icon":"","menu_image":"","menu_image_css":"","menu_text":1,"menu_show":1}</params>
  </menuitem>
</menu>

The problem is that in J4 the detection of children is not working

avatar brianteeman brianteeman - open - 14 Mar 2022
avatar joomla-cms-bot joomla-cms-bot - change - 14 Mar 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 14 Mar 2022
avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 17 Feb 2023
avatar Hackwar Hackwar - change - 25 Aug 2023
Labels Added: PBF
avatar Hackwar Hackwar - labeled - 25 Aug 2023
avatar brianteeman brianteeman - change - 1 Sep 2023
Labels Removed: PBF
avatar brianteeman brianteeman - unlabeled - 1 Sep 2023
avatar Hackwar Hackwar - close - 28 Mar 2024
avatar Hackwar
Hackwar - comment - 28 Mar 2024

I created a PR: #43178. Closing this issue.

avatar Hackwar Hackwar - change - 28 Mar 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-03-28 18:29:39
Closed_By Hackwar

Add a Comment

Login with GitHub to post a comment