@@ -, +, @@ GetBranchName --- C4/Acquisition.pm | 4 +++- C4/Auth.pm | 7 ++++--- C4/Search.pm | 1 - svc/holds | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) --- a/C4/Acquisition.pm +++ a/C4/Acquisition.pm @@ -377,13 +377,15 @@ sub GetBasketGroupAsCSV { booksellerpostal => $bookseller->{postal}, contractnumber => $contract->{contractnumber}, contractname => $contract->{contractname}, + }; + my $temp = { basketgroupdeliveryplace => $basketgroup->{deliveryplace}, basketgroupbillingplace => $basketgroup->{billingplace}, basketdeliveryplace => $basket->{deliveryplace}, basketbillingplace => $basket->{billingplace}, }; for my $place (qw( basketgroupdeliveryplace basketgroupbillingplace basketdeliveryplace basketbillingplace )) { - if ( my $library = Koha::Libraries->find( $row->{deliveryplace} ) ) { + if ( my $library = Koha::Libraries->find( $temp->{$place} ) ) { $row->{$place} = $library->branchname; } } --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -34,7 +34,6 @@ use Koha; use Koha::AuthUtils qw(get_script_name hash_password); use Koha::Libraries; use Koha::LibraryCategories; -use Koha::Libraries; use POSIX qw/strftime/; use List::MoreUtils qw/ any /; use Encode qw( encode is_utf8); @@ -1075,7 +1074,8 @@ sub checkauth { # if they specify at login, use that if ( $query->param('branch') ) { $branchcode = $query->param('branch'); - $branchname = Koha::Libraries->find($branchcode)->branchname; + my $library = Koha::Libraries->find($branchcode); + $branchname = $library? $library->branchname: ''; } my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search }; if ( C4::Context->boolean_preference('IndependentBranches') && C4::Context->boolean_preference('Autolocation') ) { @@ -1525,7 +1525,8 @@ sub check_api_auth { # if they specify at login, use that if ( $query->param('branch') ) { $branchcode = $query->param('branch'); - $branchname = Koha::Libraries->find($branchcode)->branchname; + my $library = Koha::Libraries->find($branchcode); + $branchname = $library? $library->branchname: ''; } my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search }; foreach my $br ( keys %$branches ) { --- a/C4/Search.pm +++ a/C4/Search.pm @@ -31,7 +31,6 @@ use C4::XSLT; use C4::Reserves; # GetReserveStatus use C4::Debug; use C4::Charset; -use Koha::Libraries; use YAML; use URI::Escape; use Business::ISBN; --- a/svc/holds +++ a/svc/holds @@ -30,6 +30,7 @@ use C4::Context; use Koha::DateUtils; use Koha::Holds; +use Koha::Libraries; my $input = new CGI; --