@@ -, +, @@ --- Koha/Schema/Result/Biblio.pm | 6 ------ Koha/Schema/Result/Item.pm | 8 +------- t/db_dependent/Items.t | 3 ++- 3 files changed, 3 insertions(+), 14 deletions(-) --- a/Koha/Schema/Result/Biblio.pm +++ a/Koha/Schema/Result/Biblio.pm @@ -331,10 +331,4 @@ __PACKAGE__->many_to_many("sets", "oai_sets_biblios", "set"); # Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0//8OGf7OteNnwT03g4QsA -sub biblioitem { - my ( $self ) = @_; - my @biblioitems = $self->biblioitems; - return $biblioitems[0]; -} - 1; --- a/Koha/Schema/Result/Item.pm +++ a/Koha/Schema/Result/Item.pm @@ -612,12 +612,6 @@ __PACKAGE__->might_have( # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Rc89LTrsDtt8Y6yXVUdhMA -sub biblioitem { - my ( $self ) = @_; - my @biblioitems = $self->biblioitemnumber; - return $biblioitems[0]; -} - sub effective_itemtype { my ( $self ) = @_; @@ -625,7 +619,7 @@ sub effective_itemtype { if ( $pref->value() ) { return $self->itype(); } else { - return $self->biblioitem()->itemtype(); + return $self->biblioitemnumber()->itemtype(); } } --- a/t/db_dependent/Items.t +++ a/t/db_dependent/Items.t @@ -204,7 +204,8 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { } ); - my ( $item ) = $biblio->biblioitem->items(); + my @bi = $biblio->biblioitems(); + my ( $item ) = $bi[0]->items(); C4::Context->set_preference( 'item-level_itypes', 0 ); ok( $item->effective_itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); --