From 1640dc10c7da2b2f328843481e868c2b4953bab7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 7 May 2026 13:57:27 +0200 Subject: [PATCH] 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 Signed-off-by: David Nind Signed-off-by: Lucas Gass --- .../prog/en/modules/reports/guided_reports_start.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 968c80790d..d58bb2915e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -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);