Bug 29840: Deal with non-existing biblionumber in opac-reserve
We should not explode if the biblionumber passed in not in DB. Test plan: Hit /cgi-bin/koha/opac-reserve.pl?biblionumber=42424 and notice the error message. Without this patch you got Can't call method "holds" on an undefined value at /kohadevbox/koha/opac/opac-reserve.pl line 172 Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
53b693bae4
commit
db07ca09cc
1 changed files with 2 additions and 0 deletions
|
@ -168,6 +168,8 @@ foreach my $biblioNumber (@biblionumbers) {
|
||||||
|
|
||||||
# Compute the priority rank.
|
# Compute the priority rank.
|
||||||
my $biblio = Koha::Biblios->find( $biblioNumber );
|
my $biblio = Koha::Biblios->find( $biblioNumber );
|
||||||
|
next unless $biblio;
|
||||||
|
|
||||||
$biblioData->{object} = $biblio;
|
$biblioData->{object} = $biblio;
|
||||||
my $holds = $biblio->holds;
|
my $holds = $biblio->holds;
|
||||||
my $rank = $holds->count;
|
my $rank = $holds->count;
|
||||||
|
|
Loading…
Reference in a new issue