From 6055e513677ac0448582b60cdaf19bfcbaaadd96 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 --- 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; } }, { -- 2.20.1