From 60946fe09ecc12c20c9d37d16742f4a5b6331086 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 18 Dec 2019 11:09:51 +0100 Subject: [PATCH] Bug 24166: Do not hang when displaying checkout list if barcode is not set If a barcode is not set, there is a JS error in the log: TypeError: oObj.barcode is null We should not call escapeHtml() on it if not barcode is set for a given item. Test plan: Check an item out Remove its barcode Load the checkout list => Without this patch you get the "loading" popup and the table is never displayed => With this patch applied you see the checkout list Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson (cherry picked from commit d2e1034084c9310498607e1d5e4156c40d7b2245) Signed-off-by: Lucas Gass (cherry picked from commit 69a7644360a62693c07beb52806a525c2c28b891) Signed-off-by: Hayley Mapley --- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 093a3982f1..8ac6b4e57f 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -282,7 +282,7 @@ $(document).ready(function() { + "#" + oObj.itemnumber + "'>" - + oObj.barcode.escapeHtml() + + (oObj.barcode ? oObj.barcode.escapeHtml() : "") + "" + onsite_checkout @@ -637,7 +637,7 @@ $(document).ready(function() { + "#" + oObj.itemnumber + "'>" - + oObj.barcode.escapeHtml() + + (oObj.barcode ? oObj.barcode.escapeHtml() : "") + "" + onsite_checkout; -- 2.39.5