From 1e90641cd64e42b10079e75f092f63ee6f6281a4 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 Signed-off-by: Fridolin Somers Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- Koha/Template/Plugin/AuthorisedValues.pm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Koha/Template/Plugin/AuthorisedValues.pm b/Koha/Template/Plugin/AuthorisedValues.pm index b15136e5b7..ae90288fb7 100644 --- a/Koha/Template/Plugin/AuthorisedValues.pm +++ b/Koha/Template/Plugin/AuthorisedValues.pm @@ -81,13 +81,17 @@ 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} + } + } elsif ($av->{lib}) { + $av_check = $av->{lib} + } + return $av_check } 1; -- 2.39.5