From 9d0729a9869fd1cda790cd06b92e0e7b8f0ceaec Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 27 Aug 2020 09:49:11 +0200 Subject: [PATCH] Bug 8676: Don't assume marc strucure is passed --- C4/Biblio.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 6b43c2e81e..1a5610f601 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1363,10 +1363,6 @@ descriptions rather than normal ones when they exist. sub GetAuthorisedValueDesc { my ( $tag, $subfield, $value, $framework, $tagslib, $category, $opac ) = @_; - if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.booksellerid' ) { - my $vendor = Koha::Acquisition::Booksellers->find($value); - return $vendor ? $vendor->name : $value; - } if ( !$category ) { return $value unless defined $tagslib->{$tag}->{$subfield}->{'authorised_value'}; @@ -1387,6 +1383,11 @@ sub GetAuthorisedValueDesc { $category = $tagslib->{$tag}->{$subfield}->{'authorised_value'}; } + if ( $tagslib && $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.booksellerid' ) { + my $vendor = Koha::Acquisition::Booksellers->find($value); + return $vendor ? $vendor->name : $value; + } + my $dbh = C4::Context->dbh; if ( $category ne "" ) { my $sth = $dbh->prepare( "SELECT lib, lib_opac FROM authorised_values WHERE category = ? AND authorised_value = ?" ); -- 2.20.1