Bug 15098: Itemtype description missing from facets for itypes in a search group
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 <veron@veron.ch> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
25bd92bc3e
commit
55456b6e7f
1 changed files with 3 additions and 1 deletions
|
@ -218,6 +218,8 @@ foreach my $itemtype ( keys %{$itemtypes} ) {
|
||||||
$itemtypes->{$itemtype}->{translated_description} =
|
$itemtypes->{$itemtype}->{translated_description} =
|
||||||
( $translated_description ) ? $translated_description : $itemtypes->{$itemtype}->{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
|
# the index parameter is different for item-level itemtypes
|
||||||
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
|
my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
|
||||||
my @advancedsearchesloop;
|
my @advancedsearchesloop;
|
||||||
|
@ -599,7 +601,7 @@ if ($tag) {
|
||||||
$pasarParams .= '&simple_query=' . uri_escape_utf8($simple_query);
|
$pasarParams .= '&simple_query=' . uri_escape_utf8($simple_query);
|
||||||
$pasarParams .= '&query_type=' . uri_escape_utf8($query_type) if ($query_type);
|
$pasarParams .= '&query_type=' . uri_escape_utf8($query_type) if ($query_type);
|
||||||
eval {
|
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
|
# This sorts the facets into alphabetical order
|
||||||
|
|
Loading…
Reference in a new issue