Bug 19315: Prevent crash if no items and not library set for the subscription
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
parent
e576b89c46
commit
71e3928b7b
|
|
@ -63,13 +63,14 @@ my $subs = GetSubscription($subscriptionid);
|
|||
my ($tmp ,@serials) = GetSerials($subscriptionid);
|
||||
my ($template, $loggedinuser, $cookie);
|
||||
|
||||
my $library;
|
||||
if($ok){
|
||||
# get biblio information....
|
||||
my $biblionumber = $subs->{'bibnum'};
|
||||
my ($count2,@bibitems) = GetBiblioItemByBiblioNumber($biblionumber);
|
||||
my @itemresults = GetItemsInfo( $biblionumber );
|
||||
my $branch = @itemresults ? $itemresults[0]->{'holdingbranch'} : $subs->{branchcode};
|
||||
my $branchname = Koha::Libraries->find($branch)->branchname;
|
||||
$library = Koha::Libraries->find($branch);
|
||||
|
||||
if (C4::Context->preference('RoutingListAddReserves')){
|
||||
# get existing reserves .....
|
||||
|
|
@ -108,7 +109,6 @@ if($ok){
|
|||
flagsrequired => {serials => '*'},
|
||||
debug => 1,
|
||||
});
|
||||
$template->param("libraryname"=>$branchname);
|
||||
} else {
|
||||
($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "serials/routing-preview.tt",
|
||||
|
|
@ -120,6 +120,8 @@ if($ok){
|
|||
});
|
||||
}
|
||||
|
||||
$template->param( libraryname => $library->branchname ) if $library;
|
||||
|
||||
my $memberloop = [];
|
||||
for my $routing (@routinglist) {
|
||||
my $member = Koha::Patrons->find( $routing->{borrowernumber} )->unblessed;
|
||||
|
|
|
|||
Loading…
Reference in New Issue