If the itemtype is marked as hidden in OPAC, only the itype code is shown in the facets.
Hi Katrin, I do not know how to reproduce the issue. What I did: - Mark a item type as hidden in Opac - This item type no longer appears in Opac on advanced search, as advertised near "Hide in Opac": "(if checked, items of this type will be hidden as filters in OPAC's advanced search)" - Go to Opac. Do a search. - Item Types appear at teh left in facets. They all have their names ( Books, E-Book ...)
For me the problem is not when hideinopac is set, but when the item type is assigned to a search group (talking about Item types in facets)
I think Bernardo is right - I had testd those 2 new features and probably named the wrong cause. Changing bug title - thx for testing!
Following findings: opac/opac-search.pl line 213 calls GetItemTypesCategorized and then resolves the codes to the descriptions But C4/Koha.pm, GetItemTypesCategorized, line 303 has: SELECT itemtype, description, imageurl, hideinopac, 0 as 'iscat' FROM itemtypes WHERE ISNULL(searchcategory) or length(searchcategory) = 0 (...) If I remove the WHERE clause, the label appears in the facet as expected (Books isntead of BK in my test case). I think this is the place for some more digging. Where is GetItemTypesCategorized used, is it possible to remove the where clause without side effects (No, I'm afraid), do we need a variant without where clause for the facets?
(In reply to Marc Véron from comment #4) > > If I remove the WHERE clause, the label appears in the facet as expected > (Books isntead of BK in my test case). > > I think this is the place for some more digging. Where is > GetItemTypesCategorized used, is it possible to remove the where clause > without side effects (No, I'm afraid), do we need a variant without where > clause for the facets? I'm afraid not.GetItemTypesCategorized is used to get item types and search groups. But as you said, we need to dig a little more :)
Created attachment 44364 [details] [review] 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
Created attachment 44368 [details] [review] 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>
Created attachment 44455 [details] [review] [PASSED QA] 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>
Patch pushed to master. Thanks Bernardo!