@@ -, +, @@ --- Koha/Schema/Result/Item.pm | 2 +- t/db_dependent/Items.t | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/Koha/Schema/Result/Item.pm +++ a/Koha/Schema/Result/Item.pm @@ -625,7 +625,7 @@ __PACKAGE__->belongs_to( ); use C4::Context; -sub itemtype { +sub effective_itemtype { my ( $self ) = @_; if ( C4::Context->preference('item-level_itypes') ) { --- a/t/db_dependent/Items.t +++ a/t/db_dependent/Items.t @@ -170,10 +170,10 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { my ( $item ) = $biblioitem->items(); C4::Context->set_preference( 'item-level_itypes', 0 ); - ok( $item->itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); + ok( $item->effective_itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); C4::Context->set_preference( 'item-level_itypes', 1 ); - ok( $item->itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is disabled' ); + ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is disabled' ); $dbh->rollback; --