From c60ac731a2863206ef48760805e86fab7ef72bab Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 2 Dec 2020 11:25:13 +0100 Subject: [PATCH] Bug 26797: Escape firstname to prevent relative's checkouts to crash If no firstname is defined for a relative, the "Relative's checkouts" tab will be "processing" forever. JS error: TypeError: oObj.borrower.firstname is null Test plan: Patron A is Org and guarantor of patron B Check an item out to B Go to the details page of A, click "Relative's checkouts" Signed-off-by: Kelly McElligott --- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index f3cb49611b..3dc0b8dcfd 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -817,10 +817,10 @@ $(document).ready(function() { { "mDataProp": function( oObj ) { return "" - + oObj.borrower.firstname.escapeHtml() + + ( oObj.borrower.firstname ? oObj.borrower.firstname.escapeHtml() : "" ) + " " + - oObj.borrower.surname.escapeHtml() - + " (" + oObj.borrower.cardnumber.escapeHtml() + ")" + ( oObj.borrower.surname ? oObj.borrower.surname.escapeHtml() : "" ) + + " (" + ( oObj.borrower.cardnumber ? oObj.borrower.cardnumber.escapeHtml() : "" ) + ")" } }, ], -- 2.11.0