From 41ce80eb12e738a55c697f51ecfb32a932a38959 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 27 Jun 2022 17:20:55 +0100 Subject: [PATCH] Bug 31087: Prevent stringification of null in return claims The return claims table was stringifying 'null'. This patch updates the code to check for definition so we don't stringify incorrectly Note: This patch was split out from a follow-up on bug 28854 as we felt it should be treated separately for backportability. Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 471ec6bc68..965aec6cf0 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -1010,8 +1010,13 @@ $(document).ready(function() { { "sClass": "return-claim-notes-td", "mDataProp": function ( oObj ) { - return '' + oObj.notes + '' - + ''; + let notes = ''; + if ( oObj.notes ) { + notes += oObj.notes; + } + notes += ''; + notes += ''; + return notes; } }, {