From 0361fee0e447b5dba2918b7d771e2db602435458 Mon Sep 17 00:00:00 2001 From: Paul Derscheid Date: Fri, 17 Apr 2026 09:29:41 +0200 Subject: [PATCH] Bug 42278: (follow-up) Guard bare-RHS TT interpolations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Several unquoted const assignments rendered to `const X = ;` when their TT expression was empty (patron.borrowernumber without a patron, CAN_user_circulate_manage_bookings absent, or the AlwaysLoadCheckoutsTable syspref unset). The parser aborted the whole script block, so has_patron, AlwaysLoadCheckoutsTable, etc. were never defined and later scripts failed with ReferenceError. Add TT fallbacks so the RHS is always a valid JS literal. To test: - /cgi-bin/koha/circ/circulation.pl with no patron → no console errors - Search a patron, check out an item → still works Signed-off-by: Paul Derscheid Signed-off-by: Jan Kissig Signed-off-by: Pedro Amorim --- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index a6b8249824..0cede7b118 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -1131,7 +1131,7 @@