From 10dd67afed5c24fb60a44decfd1b20339ee92a66 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 22 Aug 2018 15:10:38 +0000 Subject: [PATCH] Bug 21257: Return blank strings instead of null in svc/checkouts To test: 1 - Find an item with no collection or location defined 2 - Check it out to a patron 3 - Note you cannot view the checkouts table 4 - Check the console: TypeError: oObj.collection is null 5 - Apply patch 6 - Restart all the things 7 - Checkouts table should load Signed-off-by: Tomas Cohen Arazi Works as expected! --- svc/checkouts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svc/checkouts b/svc/checkouts index 9a1b3a5648..75fe227ee9 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -151,12 +151,12 @@ while ( my $c = $sth->fetchrow_hashref() ) { GetRenewCount( $c->{borrowernumber}, $c->{itemnumber} ); my $itemtype = Koha::ItemTypes->find( $item_level_itypes ? $c->{itype} : $c->{itemtype} ); - my $location; + my $location = ""; if ( $c->{location} ) { my $av = Koha::AuthorisedValues->search({ category => 'LOC', authorised_value => $c->{location} }); $location = $av->count ? $av->next->lib : ''; } - my $collection; + my $collection = ""; if ( $c->{collection} ) { my $av = Koha::AuthorisedValues->search({ category => 'CCODE', authorised_value => $c->{collection} }); $collection = $av->count ? $av->next->lib : ''; -- 2.18.0