[1] Acquisition.pm
The lines filling $row in GetBasketGroupAsCSV may have side-effects when
the library name is not found. This change restores former behavior. Just
theoretically more safe.
Note that it also contained a typo: $row->{deliveryplace} should have been
$row->{$place}.
[2] Auth.pm
checkauth: $branchname = Koha::Libraries->find($branchcode)->branchname;
Should normally be fine, but I rather have an empty string here than
crashing on "Can't call method branchname on undefined value".
Same for sub check_api_auth.
Note that this holds for a larger number of calls, but I am adding a check
here because it is checkauth.
Also removed a duplicate use Koha::Libraries-statement.
[3] Search.pm
Also removed a duplicate use statement for Libraries.
[4] svc/holds
Added an (explicit) use statement for Koha::Libraries.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
booksellerpostal => $bookseller->{postal},
contractnumber => $contract->{contractnumber},
contractname => $contract->{contractname},
booksellerpostal => $bookseller->{postal},
contractnumber => $contract->{contractnumber},
contractname => $contract->{contractname},
basketgroupdeliveryplace => $basketgroup->{deliveryplace},
basketgroupbillingplace => $basketgroup->{billingplace},
basketdeliveryplace => $basket->{deliveryplace},
basketbillingplace => $basket->{billingplace},
};
for my $place (qw( basketgroupdeliveryplace basketgroupbillingplace basketdeliveryplace basketbillingplace )) {
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;
}
}
$row->{$place} = $library->branchname;
}
}
use Koha::AuthUtils qw(get_script_name hash_password);
use Koha::Libraries;
use Koha::LibraryCategories;
use Koha::AuthUtils qw(get_script_name hash_password);
use Koha::Libraries;
use Koha::LibraryCategories;
use POSIX qw/strftime/;
use List::MoreUtils qw/ any /;
use Encode qw( encode is_utf8);
use POSIX qw/strftime/;
use List::MoreUtils qw/ any /;
use Encode qw( encode is_utf8);
# if they specify at login, use that
if ( $query->param('branch') ) {
$branchcode = $query->param('branch');
# 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') ) {
}
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search };
if ( C4::Context->boolean_preference('IndependentBranches') && C4::Context->boolean_preference('Autolocation') ) {
# if they specify at login, use that
if ( $query->param('branch') ) {
$branchcode = $query->param('branch');
# 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 ) {
}
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search };
foreach my $br ( keys %$branches ) {
use C4::Reserves; # GetReserveStatus
use C4::Debug;
use C4::Charset;
use C4::Reserves; # GetReserveStatus
use C4::Debug;
use C4::Charset;
use YAML;
use URI::Escape;
use Business::ISBN;
use YAML;
use URI::Escape;
use Business::ISBN;
use Koha::DateUtils;
use Koha::Holds;
use Koha::DateUtils;
use Koha::Holds;