Strange sorting behavior when menu links have the same weight

Created on 7 February 2025, about 1 month ago

Problem/Motivation

The order in which menu items are shown in the jsTree of the HM menu editor appears to be ill-defined when the weights of the menu items are identical. By default they appear to sort in the opposite order in which Drupal shows them on a rendered page. Messing with the jsTree can also at least temporarily change the order displayed in the jsTree without changing the weights.

Steps to reproduce

Create a new menu and enable HM for it. Use an HM display profile that confirms drag & drop but is otherwise the default.

Add a menu item "A" and a menu item "B" without modifying their weights. The order of items in the HM menu editor is B, A.

Place the test menu block somewhere on a page. The order of items shown in the menu on the page is A, B.

In the HM menu editor, drag A into B. On the popup confirming, select NO. The order of items in the HM menu editor is now A, B.

Proposed resolution

Make the ordering in the HM menu editor consistent, and make it match what Drupal shows on the page.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.4

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024