https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39516 --- Comment #15 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 197241 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197241&action=edit Bug 39516: (follow-up) Fix column drift when columns are hidden The records-table row callback populated cells with positional `$("td:eq(N)", nRow)` selectors. When a user hid a column (e.g. the new "Score breakdown" column) via admin/columns_settings.yml, the subsequent cells' positional indices shifted, causing the score breakdown values to render into the Diff column. Tag each rendered cell with `data-colname` via `createdCell` and replace every `td:eq(N)` selector with a `td[data-colname='NAME']` selector. Name-based selectors are unaffected when a column is hidden: the selector simply matches zero elements and the append is a no-op, while the remaining columns continue to receive the correct content. This aligns with the `bKohaColumnsUseNames` convention already used by datatables.js (`_dt_visibility`, `_dt_force_visibility`, the colvis button). Test plan: 1. Stage a MARC file whose records produce matches (populating composite_scores). 2. Confirm Match details, Score breakdown and Diff cells render correctly with the default column layout. 3. Go to Administration > Table settings > tools > manage-marc-import > records-table and hide the "Score breakdown" column. Reload the staged batch view. 4. Verify the Score breakdown column is gone, the Diff column still shows "View" links, and the Record column still shows View/Edit buttons. 5. Repeat for other toggleable columns (Match details, Diff, Record) and confirm no drift. Signed-off-by: Jeanne Mauriello <jeanne.mauriello@mainlib.org> -- You are receiving this mail because: You are watching all bug changes.