From d95a4acfb01e949afee71b0daa1c4ba01bb42f0f Mon Sep 17 00:00:00 2001 From: Christopher Brannon Date: Wed, 17 Oct 2018 21:19:43 +0000 Subject: [PATCH] Bug 21503: Changed logic for checking values --- Koha/Template/Plugin/AuthorisedValues.pm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Koha/Template/Plugin/AuthorisedValues.pm b/Koha/Template/Plugin/AuthorisedValues.pm index e704d5f2dd..a926e0fba4 100644 --- a/Koha/Template/Plugin/AuthorisedValues.pm +++ b/Koha/Template/Plugin/AuthorisedValues.pm @@ -82,13 +82,19 @@ sub GetDescriptionByKohaField { authorised_value => $params->{authorised_value}, } ); - return %$av - ? $params->{opac} - ? $av->{opac_description} - : $av->{lib} - : $params->{authorised_value} - ? $params->{authorised_value} - : '' + my $av_check = $params->{authorised_value}; + if ($params->{opac}) { + if ($av->{opac_description}) { + $av_check = $av->{opac_description} + } elsif ($av->{lib}) { + $av_check = $av->{lib} + } + } else { + if ($av->{lib}) { + $av_check = $av->{lib} + } + } + return $av_check } 1; -- 2.11.0