From 29e3d3d7fe13237fcd5d28dcdc5f9d7bf980513b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 25 Nov 2021 12:33:34 +0000 Subject: [PATCH] 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 Signed-off-by: Fridolin Somers --- koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc index 3df91d35b2..ea9ff6b683 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc @@ -15,7 +15,7 @@ } var title = null; - if ( patron.title != null ) { + if ( patron.title != null && patron.title != '' ) { title = '' + escape_str(patron.title) + ''; } @@ -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 ) { -- 2.39.5