View | Details | Raw Unified | Return to bug 11518
Collapse All | Expand All

(-)a/Koha/Schema/Result/Item.pm (-1 / +1 lines)
Lines 625-631 __PACKAGE__->belongs_to( Link Here
625
);
625
);
626
626
627
use C4::Context;
627
use C4::Context;
628
sub itemtype {
628
sub effective_itemtype {
629
    my ( $self ) = @_;
629
    my ( $self ) = @_;
630
630
631
    if ( C4::Context->preference('item-level_itypes') ) {
631
    if ( C4::Context->preference('item-level_itypes') ) {
(-)a/t/db_dependent/Items.t (-3 / +2 lines)
Lines 170-179 subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { Link Here
170
    my ( $item ) = $biblioitem->items();
170
    my ( $item ) = $biblioitem->items();
171
171
172
    C4::Context->set_preference( 'item-level_itypes', 0 );
172
    C4::Context->set_preference( 'item-level_itypes', 0 );
173
    ok( $item->itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' );
173
    ok( $item->effective_itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' );
174
174
175
    C4::Context->set_preference( 'item-level_itypes', 1 );
175
    C4::Context->set_preference( 'item-level_itypes', 1 );
176
    ok( $item->itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is disabled' );
176
    ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is disabled' );
177
177
178
178
179
    $dbh->rollback;
179
    $dbh->rollback;
180
- 

Return to bug 11518