From 64e203fe93dc781e88e02fcb91bb4971b28ee1e6 Mon Sep 17 00:00:00 2001 From: Paul Derscheid Date: Fri, 6 Mar 2026 18:37:06 +0100 Subject: [PATCH] Bug 41797: (QA follow-up) Fix empty results truthiness check - The tidy converted a TT compile-time [% IF results %] to a runtime JS check on original_results - original_results is always an array (fallback to []) and an empty array is truthy in JS, so the chart click handler was always registered even with no results - Check .length instead to match the original server-side behavior Signed-off-by: Paul Derscheid --- .../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 e236c9cbd56..fb72d0f7b19 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 @@ -2120,7 +2120,7 @@ $("#download-chart").hide(); var chart; - if (original_results && !has_errors) { + if (original_results.length && !has_errors) { $("#draw-chart").click(function () { var x_elements = $('select[name="x"]').val(); var y_elements = []; -- 2.39.5