From 94d13f43869a285b6372ff6d6cb213d955e99f65 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 Bug 21503: Simplify If Else logic Signed-off-by: Fridolin Somers Signed-off-by: Jonathan Druart --- 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.20.1