From 9464f9303b861f0b44a6e0bf88f26adc4d28e7d4 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 25 Nov 2021 12:33:34 +0000 Subject: [PATCH] Bug 27975: (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. https://bugs.koha-community.org/show_bug.cgi?id=29575 --- 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