Bug 11518 [QA Followup]
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 10 Apr 2014 17:46:34 +0000 (13:46 -0400)
committerMason James <mtj@kohaaloha.com>
Mon, 19 Jan 2015 03:22:59 +0000 (16:22 +1300)
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

Koha/Schema/Result/Item.pm

index 6a1e0d2..fd50d15 100644 (file)
@@ -624,11 +624,11 @@ __PACKAGE__->belongs_to(
   { biblioitemnumber => "biblioitemnumber" },
 );
 
-use C4::Context;
 sub effective_itemtype {
     my ( $self ) = @_;
 
-    if ( C4::Context->preference('item-level_itypes') ) {
+    my $pref = $self->result_source->schema->resultset('Systempreference')->find('item-level_itypes');
+    if ( $pref->value() ) {
         return $self->itype();
     } else {
         return $self->biblioitem()->itemtype();