From f68b1807aea33a1c9bfcc13b9eef5502d0986ce8 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 --- 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 01be72b763..0d73aed520 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -338,7 +338,7 @@ $(document).ready(function() { + "#" + oObj.itemnumber + "'>" - + oObj.barcode.escapeHtml() + + (oObj.barcode ? oObj.barcode.escapeHtml() : "") + "" + onsite_checkout @@ -721,7 +721,7 @@ $(document).ready(function() { + "#" + oObj.itemnumber + "'>" - + oObj.barcode.escapeHtml() + + (oObj.barcode ? oObj.barcode.escapeHtml() : "") + "" + onsite_checkout; -- 2.11.0