Bug 34083: (follow-up) Prevent showing 'null'

In patron lists, if the patron added is an organization without the firstname, it presents 'null'. This fixes that

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Pedro Amorim 2023-06-22 08:58:34 +00:00 committed by Tomas Cohen Arazi
parent a8e9b25d8e
commit 17e19fe311
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -256,7 +256,7 @@
patron_autocomplete($("#find_patron"), {
'on-select-callback': function( event, ui ) {
var field = ui.item.cardnumber;
AddPatron( ui.item.firstname + " " + ( ui.item.middle_name || "" ) + " " + ui.item.surname, field, $("#patrons_to_add"), 'patrons_to_add' );
AddPatron( ( ui.item.firstname || "" ) + " " + ( ui.item.middle_name || "" ) + " " + ( ui.item.surname || "" ), field, $("#patrons_to_add"), 'patrons_to_add' );
$("#find_patron").val('').focus();
return false;
}