Problem/Motivation

On the latest Drupal 11 (haven't bisected the exact version it broke), drag-and-drop in an entity_reference_hierarchy field fails with a JS error Uncaught TypeError: Cannot read properties of undefined (reading 'matches') in tabledrag.js. The only way to nest items is by manually updating the Depth/Order fields.

Steps to reproduce

Install module on latest Drupal 11. Add the field type to an entity. On the entity add/edit form, note that the drag and drop functionality for moving items within the hierarchy is broken.

Proposed resolution

Issue appears to be related to a change of some tabledrag class names in core. Easy fix by updating entity_reference_hierarchy.module. Proposed MR will be added shortly.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

odensc created an issue. See original summary.

odensc changed the visibility of the branch 3584556-fix-drag-and-drop to hidden.

odensc changed the visibility of the branch 3584556-fix-drag-and-drop to active.

odensc’s picture

Status: Active » Needs review

dwkitchen’s picture

Assigned: Unassigned » dwkitchen

Thanks for finding, I will track down which version of Drupal introduced this change and split the releases.

  • dwkitchen committed 6648724c on 1.0.x
    fix: #3584556 drag-and-drop functionality broken
    

  • dwkitchen committed b87afea7 on 1.0.x
    feat: #3584556 Drag-and-drop functionality broken on latest Drupal 11...
dwkitchen’s picture

Assigned: dwkitchen » Unassigned
Status: Needs review » Fixed

Seems it should have been like that since D9, but as I have been using IEF, I had missed it.
I have also made the same changes in the Paragraphs submodule.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.