From 1eab1bdc811a2b277f7729a530b5012bd0764576 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=UTF-8 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 --- 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 1780b55..1f5413f 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'; -- 1.7.10.4