From 55456b6e7ff0278f2821a71c38b9a5b67bfd4220 Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Wed, 4 Nov 2015 09:24:10 -0300 Subject: [PATCH] Bug 15098: Itemtype description missing from facets for itypes in a search group MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch adds a second variable to hold item types info just for facets. In case we have an item type in a search category, it's description is removed from GetItemTypesCategorized, which is good for advanced search, but no for facets A second var is needed which holds all item type info. To test: On top of Bug 15092 patches (no really needed, but I write this on top of them) 1) Add an item type to a search group 2) Do a search in opac, in facets will see only item type code, no description, for that item type 3) Apply the patch 4) Repeat search, now description must be present Followed test plan including translated descriptions. Works as expected. Signed-off-by: Marc Véron Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- opac/opac-search.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 1f5413fd03..03d9af7bd2 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -218,6 +218,8 @@ foreach my $itemtype ( keys %{$itemtypes} ) { $itemtypes->{$itemtype}->{translated_description} = ( $translated_description ) ? $translated_description : $itemtypes->{$itemtype}->{description}; } +# Load the Type stuff without search categories for facets +my $itemtypes_nocategory = GetItemTypes; # the index parameter is different for item-level itemtypes my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; my @advancedsearchesloop; @@ -599,7 +601,7 @@ if ($tag) { $pasarParams .= '&simple_query=' . uri_escape_utf8($simple_query); $pasarParams .= '&query_type=' . uri_escape_utf8($query_type) if ($query_type); eval { - ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes,$query_type,$scan,1); + ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes_nocategory,$query_type,$scan,1); }; } # This sorts the facets into alphabetical order -- 2.39.5