From 508927139aeba90356255915a09a9053dd165593 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 12 Apr 2023 11:49:51 +0100 Subject: [PATCH] Bug 33504: Update patron_to_html to deal with null In the patron_to_html function we were dealing explicitly with the case where patron may be passed undefined, but forgetting that it may be returned as 'null' from the api too. Changing from `( patron === undefined )` to `( patron == null )` is the recommended approach for detecting 'undefined or null' in javascript. --- koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5e125dbc29..3f8cb940ee 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 @@ -9,7 +9,7 @@ */ window.$patron_to_html = function( patron, config ) { - if ( patron === undefined ) { + if ( patron == null ) { return ''; // empty string for no patron } -- 2.40.0