Bug 11518: (follow-up) retrieve syspref value using DBIC

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Kyle Hall 2014-04-10 13:46:34 -04:00 committed by Galen Charlton
parent c3c7105fe7
commit 8a27907948

View 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();