Bug 43394: DT - Cast pageLength to Integer

In "Edit patron card batch" the pageLength is coming from the syspref,
the value is a string.
But DataTable's needs an integer.
Let's fix this in datatables.js, in the kohaTable's constructor

Test plan:
Got to cgi-bin/koha/patroncards/edit-batch.pl
Enter more than 20 borrowernumbers and "Add patron(s)"
Click "next" and notice that with this patch the pagination works.
Without this patch the JS error is
"Uncaught TypeError: can't access property "nTr", p is undefined"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Jonathan Druart 2026-08-27 16:45:08 +02:00 committed by Pedro Amorim
parent eb81e1cc5e
commit 02491b08d3
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 7 additions and 0 deletions

View File

@ -1585,6 +1585,13 @@ function update_search_description(
}
}
if (
settings.pageLength !== undefined &&
!Number.isInteger(settings.pageLength)
) {
settings.pageLength = parseInt(settings.pageLength, 10);
}
settings["buttons"] = _dt_buttons({ settings, table_settings });
var default_column_defs = [