Bug 42550: Remove JS error from report list if none exist

If there are no saved SQL reports, the "rtable" variable is empty and
triggers an error when called later.
Uncaught TypeError: can't access property "DataTable", rtable is
undefined

Test plan:
/cgi-bin/koha/reports/guided_reports.pl?op=list
Without reports
=> Without this patch there is a JS error in the console
=> With the patch the error is gone

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2026-05-07 13:57:27 +02:00 committed by Lucas Gass
parent 18f1e259e2
commit 1640dc10c7
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 1 additions and 1 deletions

View File

@ -2291,7 +2291,7 @@
},
table_settings
);
let table_dt = rtable.DataTable();
let table_dt = rtable?.DataTable();
$("#tabs a[data-bs-toggle='tab']").on("shown.bs.tab", function (e) {
tabsInit($(e.target).parent(), rtable);