From c3c7105fe7277b63174aac9ad24455f5c3d48660 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 10 Jan 2014 10:21:55 -0500 Subject: [PATCH] Bug 11518: (follow-up) Change method name from 'itemtype' to 'effective_itemtype' for clarity Test runs without errors. Signed-off-by: Benjamin Rokseth Signed-off-by: Katrin Fischer Signed-off-by: Galen Charlton --- Koha/Schema/Result/Item.pm | 2 +- t/db_dependent/Items.t | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm index 656de69512..6a1e0d268b 100644 --- a/Koha/Schema/Result/Item.pm +++ b/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') ) { diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t index a4bdd1cf5f..af7b252983 100755 --- a/t/db_dependent/Items.t +++ b/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; -- 2.39.5