Problem/Motivation
I upgraded my website from 10.1.7 to 10.2.0 and i got a visual error on administration

Steps to reproduce
1. Creates a content type with a referenced field (taxonomy) with an allowed number of values set to "Unlimted" or at least "2"
2. Upgrade your website to Drupal 10.2.0
3. Try to create a content
4. You should see exactly the same issue as me (Drag and drop with the order field and the "Show row weights" button is missing)
Proposed resolution
Simply change the colspan value from 2 to 3
Expected result

| Comment | File | Size | Author |
|---|---|---|---|
| #13 | After Patch.png | 80.87 KB | sandeep_k |
| #13 | Before Patch.png | 77.22 KB | sandeep_k |
| #2 | keywords-field-expected.png | 12.98 KB | bakop |
| keywords-field.png | 11.17 KB | bakop |
Issue fork require_on_publish-3410535
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
Comment #2
bakopComment #6
bakopPatch sent as merge request (MR!9) !
It works only for version >=10.2.0 so a new release should be published.
Comment #7
ahmad khader commentedI can confirm this issue, this is causing tabledrag.js to not work properly and is throwing an Uncaught TypeError: Cannot read properties of undefined (reading 'colSpan')
It's caused by the core adding a remove button on a separate column.
@bakop, we could change the PR to follow the normal core behavior by adding an empty th tag. (
[],)What do you think?
Comment #8
markdorisonI just left a comment with an idea on how to not drop support for versions < 10.2 and there is a different idea presented in #7. Marking this as needs work so we can see what else we can come up with.
Comment #9
bakopComment #10
bakopHello, you are both right. I modified and tested the code on versions 10.1.7 and 10.2.1
Comment #11
ahmad khader commentedthanks @bakop
I can also confirm that the code worked on 10.2.1.
Comment #12
markdorisonI pushed a revision that I believe should accomplish the same thing, but without duplicating the entire $header array. There may be a more elegant way to do this but this was my best idea so far. Could you test to ensure this approach resolves the issue?
Comment #13
sandeep_k commentedI've Tested this on a freshly installed Drupal version- 10.2.2-dev & able to reproduce this issue there as well. After reproducing this I've applied the shared patch MR !9 mergeable successfully and it looks good to me.
Testing Steps:
Testing Results:
After applying the patch, the "Show row weights" button is present now. RTBC+
Comment #14
stborchertThanks for the patch. We stumbled across this issue after updating to Drupal 10.2 and all paragraph forms were broken.
Without the patch you'll get the following javascript error:
Cannot read properties of undefined (reading 'colSpan')Comment #16
markdorison