From 5c08665be4f2b41219cb94e1164ef101b30bb7a3 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 10 Jan 2014 10:21:55 -0500 Subject: [PATCH] Bug 11518 [Followup] - Change method name from 'itemtype' to 'effective_itemtype' for clarity --- 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 656de69..6a1e0d2 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 a4bdd1c..af7b252 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; -- 1.7.2.5