From d7f91ffac92b9e35fc692fb05819f5d158eea0f7 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 25 Nov 2021 12:33:34 +0000 Subject: [PATCH] Bug 29575: (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. --- 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.20.1