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>
(cherry picked from commit 17e19fe311)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Pedro Amorim 2023-06-22 08:58:34 +00:00 committed by Martin Renvoize
parent c93e7167f6
commit fd372ddcd3
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

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;
}