Skip to content

Fix JS error when option is deleted#33

Merged
aristath merged 1 commit intodevelopfrom
filip/fix-option-remove-error
Apr 1, 2025
Merged

Fix JS error when option is deleted#33
aristath merged 1 commit intodevelopfrom
filip/fix-option-remove-error

Conversation

@ilicfilip
Copy link
Copy Markdown
Collaborator

@ilicfilip ilicfilip commented Mar 13, 2025

Context

When option is deleted there is a Javascript error in the browser console:

Uncaught TypeError: Cannot read properties of null (reading 'nTr')
    at S (datatables.min.js?ver=2.0.1:16:25194)
    at U.<anonymous> (datatables.min.js?ver=2.0.1:16:51287)
    at U.iterator (datatables.min.js?ver=2.0.1:16:46398)
    at U.<anonymous> (datatables.min.js?ver=2.0.1:16:51247)
    at U.draw (datatables.min.js?ver=2.0.1:16:47678)
    at updateRowOnSuccess (admin-script.js?ver=1741843012:240:53)
    at Object.success (admin-script.js?ver=1741843012:221:27)
    at c (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.7.2:2:25304)
    at Object.fireWith [as resolveWith] (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.7.2:2:26053)
    at l (load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.7.2:2:77782)

For the last release datatables JS library was updated to a slightly newer version, which probably caused the issue.

Looking at the docs, page param is probably not what is wanted (since data is changed). I changed it to full-hold as that seems to recalc entire table and redraw it.

@ilicfilip ilicfilip requested a review from jdevalk March 13, 2025 05:21
@github-actions
Copy link
Copy Markdown

Test on Playground
Test this pull request on the Playground

@ilicfilip ilicfilip requested a review from aristath April 1, 2025 06:13
@aristath aristath merged commit e613125 into develop Apr 1, 2025
6 checks passed
@ilicfilip ilicfilip deleted the filip/fix-option-remove-error branch May 6, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants