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

(-)a/Koha/Schema/Result/Item.pm (-1 / +1 lines)
Lines 659-665 sub effective_itemtype { Link Here
659
    if ( $pref && $self->itype() ) {
659
    if ( $pref && $self->itype() ) {
660
        return $self->itype();
660
        return $self->itype();
661
    } else {
661
    } else {
662
        warn "item-level_itypes set but no itemtype set for item ($self->itemnumber)"
662
        warn "item-level_itypes set but no itemtype set for item (".$self->itemnumber.")"
663
          if $pref;
663
          if $pref;
664
        return $self->biblioitemnumber()->itemtype();
664
        return $self->biblioitemnumber()->itemtype();
665
    }
665
    }
(-)a/t/db_dependent/Items.t (-2 / +1 lines)
Lines 281-287 subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { Link Here
281
    $item->update();
281
    $item->update();
282
    my $effective_itemtype;
282
    my $effective_itemtype;
283
    warning_is { $effective_itemtype = $item->effective_itemtype() }
283
    warning_is { $effective_itemtype = $item->effective_itemtype() }
284
                "item-level_itypes set but no itemtype set for item ($item->itemnumber)",
284
                "item-level_itypes set but no itemtype set for item (".$item->itemnumber.")",
285
                '->effective_itemtype() raises a warning when falling back to bib-level';
285
                '->effective_itemtype() raises a warning when falling back to bib-level';
286
286
287
    ok( defined $effective_itemtype &&
287
    ok( defined $effective_itemtype &&
288
- 

Return to bug 14598