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 <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 41ce80eb12)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit f055a4ae65)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
This commit is contained in:
Martin Renvoize 2022-06-27 17:20:55 +01:00 committed by Arthur Suzuki
parent 7ccea5b6f0
commit 4db72c357a
1 changed files with 7 additions and 2 deletions

View File

@ -997,8 +997,13 @@ $(document).ready(function() {
{
"sClass": "return-claim-notes-td",
"mDataProp": function ( oObj ) {
return '<span id="return-claim-notes-static-' + oObj.id + '" class="return-claim-notes" data-return-claim-id="' + oObj.id + '">' + oObj.notes + '</span>'
+ '<i style="float:right" class="fa fa-pencil-square-o" title="' + __("Double click to edit") + '"></i>';
let notes = '<span id="return-claim-notes-static-' + oObj.id + '" class="return-claim-notes" data-return-claim-id="' + oObj.id + '">';
if ( oObj.notes ) {
notes += oObj.notes;
}
notes += '</span>';
notes += '<i style="float:right" class="fa fa-pencil-square-o" title="' + __("Double click to edit") + '"></i>';
return notes;
}
},
{