diff --git a/Koha/Item.pm b/Koha/Item.pm index 4d81919e12..ffae9c8c73 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -2067,7 +2067,7 @@ Returns the effective bookability of the current item, be that item or itemtype sub effective_bookable { my ($self) = @_; - return $self->bookable if defined $self->bookable; + return $self->bookable if defined $self->bookable; return $self->itemtype->bookable if $self->itemtype; return 0; } diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t index 9d25cabefd..c5231c3ba8 100755 --- a/t/db_dependent/Koha/Item.t +++ b/t/db_dependent/Koha/Item.t @@ -3898,11 +3898,13 @@ subtest 'effective_bookable() tests' => sub { ); my $biblio_no_itype = $builder->build_sample_biblio; - $biblio_no_itype->biblioitem->set({ itemtype => undef })->store; - my $item_no_itype = $builder->build_sample_item({ - biblionumber => $biblio_no_itype->biblionumber, - itype => undef, - }); + $biblio_no_itype->biblioitem->set( { itemtype => undef } )->store; + my $item_no_itype = $builder->build_sample_item( + { + biblionumber => $biblio_no_itype->biblionumber, + itype => undef, + } + ); warning_like { is( $item_no_itype->effective_bookable, 0,