- π³πΏNew Zealand quietone
I closed π Drupal.tableDrag: column span calculated wrongly for custom column Closed: duplicate as a duplicate and am moving credit.
There is a patch in the other issue with a test. That should be compared to this make sure that we get the most robust fix and test.
While upgrading a site to 10.2.x I started to experience the "Cannot read properties of undefined (reading 'colSpan')" JS error on line 361 https://git.drupalcode.org/project/drupal/-/blob/10.2.x/core/misc/tabled...
if (index > 0) { cell = cells.filter(`:nth-child(${index})`); if (cell[0].colSpan && cell[0].colSpan > 1) { // If this cell has a colspan, mark it so we can reduce the colspan. cell.addClass('tabledrag-has-colspan'); } else { // Mark this cell so we can hide it. cell.addClass('tabledrag-hide'); } }
it seems the code is not working properly or lacks validation. I couldn't determine a test case to trigger the "tabledrag-has-colspan" on a table cell.
could it be somehow related to Issue #3089151 π TableDrag JS :first-of-type issues Needs work ?