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>
This commit is contained in:
Martin Renvoize 2022-06-27 17:20:55 +01:00 committed by Tomas Cohen Arazi
parent de90b39b4c
commit 41ce80eb12
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -1010,8 +1010,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;
}
},
{