Bug 14598: Fix warning from effective_itemtype

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-04-07 12:03:49 +01:00 committed by Kyle M Hall
parent 3fa514133b
commit ec96a0cb3f
2 changed files with 2 additions and 2 deletions

View file

@ -695,7 +695,7 @@ sub effective_itemtype {
if ( $pref && $self->itype() ) {
return $self->itype();
} else {
warn "item-level_itypes set but no itemtype set for item ($self->itemnumber)"
warn "item-level_itypes set but no itemtype set for item (".$self->itemnumber.")"
if $pref;
return $self->biblioitemnumber()->itemtype();
}

View file

@ -276,7 +276,7 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub {
$item->update();
my $effective_itemtype;
warning_is { $effective_itemtype = $item->effective_itemtype() }
"item-level_itypes set but no itemtype set for item ($item->itemnumber)",
"item-level_itypes set but no itemtype set for item (".$item->itemnumber.")",
'->effective_itemtype() raises a warning when falling back to bib-level';
ok( defined $effective_itemtype &&