From e06c5a89fd539f8cc5f43773bf2aaec5c41e63ed Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Tue, 3 Nov 2015 15:15:54 -0300 Subject: [PATCH] Bug 15092: (followup) Descriptions not show for search categories MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If we have some item types in search categories, description is not show in opac advanced search To test: 1) Add some item type to a search category 2) Go to OPAC > Advanced search empty description for that category 3) Apply the patch 4) Repeat 2), description must be present Signed-off-by: Marc Véron Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- opac/opac-search.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 1780b5518a..1f5413fd03 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -213,7 +213,10 @@ $template->param(search_languages_loop => $languages_limit_loop,); my $itemtypes = GetItemTypesCategorized; # add translated_description to itemtypes foreach my $itemtype ( keys %{$itemtypes} ) { - $itemtypes->{$itemtype}->{translated_description} = getitemtypeinfo( $itemtype, 'opac' )->{translated_description}; + # Itemtypes search categories don't have (yet) translated descriptions, they are auth values + my $translated_description = getitemtypeinfo( $itemtype, 'opac' )->{translated_description}; + $itemtypes->{$itemtype}->{translated_description} = + ( $translated_description ) ? $translated_description : $itemtypes->{$itemtype}->{description}; } # the index parameter is different for item-level itemtypes my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; -- 2.39.5