From e8abc88ea242e7092383ecfc1ad1ad27d26e144c Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Wed, 4 Nov 2015 09:24:10 -0300 Subject: [PATCH] [PASSED QA] Bug 15098: Itemtype description missing from facets for itypes in a search group MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 --- 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 1780b55..8437931 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -215,6 +215,8 @@ my $itemtypes = GetItemTypesCategorized; foreach my $itemtype ( keys %{$itemtypes} ) { $itemtypes->{$itemtype}->{translated_description} = getitemtypeinfo( $itemtype, 'opac' )->{translated_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; @@ -596,7 +598,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 -- 1.9.1