Bug 29002: (follow-up) Make CanBook more resilient
This patch adds a check for biblio existance prior to method resolution failure in Koha::Template::Plugin::Biblio. This fixes a failure case in unit tests. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
cfc63f77bb
commit
470da48af8
1 changed files with 1 additions and 0 deletions
|
@ -72,6 +72,7 @@ sub CanBook {
|
|||
my ( $self, $biblionumber ) = @_;
|
||||
|
||||
my $biblio = Koha::Biblios->find($biblionumber);
|
||||
return 0 unless $biblio;
|
||||
return $biblio->bookable_items->count ? 1 : 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue