From f7941aee28e23d0085f49f4b8f11a034608c9b48 Mon Sep 17 00:00:00 2001 From: Jan Kissig Date: Fri, 29 May 2026 10:58:00 +0000 Subject: [PATCH] Bug 42278: (QA follow-up) Fix HIGHHOLDS to JSON serialisation Using Koha::Template::Plugin::To to serialize HIGHHOLDS to JSON led to the following error: Template process failed: undef error - encountered object '2026-05-31T23:59:00', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing) at /kohadevbox/koha/Koha/Template/Plugin/To.pm line 32. This patch fixes the handling of HIGHHOLDS. Signed-off-by: Pedro Amorim --- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 5 +++-- 1 file changed, 3 insertions(+), 2 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 0cede7b118..92bad1dd35 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -1170,7 +1170,8 @@ const today_due_date_and_time = "[% today_due_date_and_time | $KohaDates dateformat => 'iso', with_hours => 1 %]"; const duedatespec = "[% duedatespec | html %]"; const override_high_holds = [% override_high_holds ? 1 : 0 | html %]; - const HIGHHOLDS = [% HIGHHOLDS ? To.json(HIGHHOLDS) : 'null' | $raw %]; + const HIGHHOLDS = [% HIGHHOLDS ? 1 : 0 | html %]; + const HIGHHOLDS_returndate = "[% HIGHHOLDS.returndate | $KohaDates %]"; const waiting_holds_barcodes = new Array(); [% FOREACH wh IN waiting_holds %] waiting_holds_barcodes.push("[% wh.item.barcode | html %]"); @@ -1286,7 +1287,7 @@ if (HIGHHOLDS) { if (!override_high_holds) { - $("input[name=duedatespec]:hidden").val(HIGHHOLDS.returndate); + $("input[name=duedatespec]:hidden").val(HIGHHOLDS_returndate); if (duedatespec === "") { $("input[name=restoreduedatespec]:hidden").val("highholds_empty"); } else {