Bug 29575: (QA follow-up) Patron fields can be empty strings

We need to account for empty strings as well as 'null' values in the
patron data structure.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Martin Renvoize 2021-11-25 12:33:34 +00:00 committed by Fridolin Somers
parent 0d35f38466
commit 29e3d3d7fe

View file

@ -15,7 +15,7 @@
}
var title = null;
if ( patron.title != null ) {
if ( patron.title != null && patron.title != '' ) {
title = '<span class="patron-title">' + escape_str(patron.title) + '</span>';
}
@ -23,7 +23,7 @@
var firstname = escape_str(patron.firstname);
var surname = escape_str(patron.surname);
if ( patron.other_name != null ) {
if ( patron.other_name != null && patron.other_name != '' ) {
firstname += ' (' + escape_str(patron.other_name) + ')';
}
if ( config && config.invert_name ) {