Bug 17134 - Facet's area shows itemtypes' code instead of item's description
Summary: Facet's area shows itemtypes' code instead of item's description
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords: Academy
Depends on: 10937 12478
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-15 18:30 UTC by Claudio Costales
Modified: 2018-06-04 20:10 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
OPAC display (42.96 KB, application/pdf)
2016-08-15 18:31 UTC, Claudio Costales
Details
image (31.79 KB, image/png)
2016-08-15 20:55 UTC, Claudio Costales
Details
Search results and comparissons (260.15 KB, application/pdf)
2016-09-08 16:46 UTC, Claudio Costales
Details
Line 619 in opac-search.pl (37.13 KB, image/png)
2016-09-28 21:12 UTC, Claudio Costales
Details
Error sample (104.30 KB, application/pdf)
2016-10-16 15:35 UTC, Claudio Costales
Details
Item type description in OPAC search (156.60 KB, application/pdf)
2017-01-18 00:17 UTC, Claudio Costales
Details
Bug 17134: Replace item types codes with category (1.19 KB, patch)
2017-01-18 21:45 UTC, Emma
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17134: Replace item types codes with category (1.26 KB, patch)
2017-01-24 15:03 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17134: Replace item types codes with category in facets (opac) (1.31 KB, patch)
2017-01-26 10:44 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Claudio Costales 2016-08-15 18:30:27 UTC
In OPAC's search results, Koha shows itemtypes' codes instead name.

See file attached.
Comment 1 Claudio Costales 2016-08-15 18:31:13 UTC
Created attachment 54491 [details]
OPAC display
Comment 2 Owen Leonard 2016-08-15 18:59:41 UTC
Did you enter a description? The screenshot highlights 'Search category,' not 'Description.' Description is what should show in the facet.
Comment 3 Claudio Costales 2016-08-15 19:09:37 UTC
Hi Owen!

Yes, it should show item's Description instead of code.
Comment 4 Claudio Costales 2016-08-15 20:26:37 UTC
Owen, this happens when an itemtype category (LIBRO) is assigned to an itemtype. Otherwise it works fine.
Comment 5 Katrin Fischer 2016-08-15 20:44:16 UTC
Did you set up your authorised value with both descriptions?
Comment 6 Claudio Costales 2016-08-15 20:54:16 UTC
Hi Katrin,

Yes, I did. See image attached.
Comment 7 Claudio Costales 2016-08-15 20:55:27 UTC
Created attachment 54493 [details]
image
Comment 8 Katrin Fischer 2016-08-15 21:02:11 UTC
Thx for the screenshot!
Comment 9 Claudio Costales 2016-08-15 21:06:39 UTC
You're welcome! 

It did not happen in prior versions of Koha.
Comment 10 Claudio Costales 2016-09-06 16:18:55 UTC
Owen, Katrin, would you please help me with this? It's a specific 16.05 error... Thanks a lot...
Comment 11 Owen Leonard 2016-09-08 15:03:57 UTC
Confirmed in master. I also find that searching by itemtype category doesn't work at all. No results. Claudio when you perform a search in the OPAC using an itemtype search category does it work?
Comment 12 Claudio Costales 2016-09-08 16:45:45 UTC
Owen! Thanks for working around this issue. Please see file attached.
Comment 13 Claudio Costales 2016-09-08 16:46:56 UTC
Created attachment 55364 [details]
Search results and comparissons
Comment 14 Claudio Costales 2016-09-10 11:46:21 UTC
Owen,

Reviewing my last file attached may be that comparissons between partial facet counts and total results are not important but the fact that advanced search with item category cirteria works.
Comment 15 Claudio Costales 2016-09-28 20:14:42 UTC
Plese discard file attachment in comment#13

I will attach a better one.
Comment 16 Claudio Costales 2016-09-28 21:12:04 UTC
I found the error.

Line 619 in /usr/share/koha/opac/cgi-bin/opac/opac-search.pl

See highlight word in image file attached.

It must say: $itemtypes_nocategory
Comment 17 Claudio Costales 2016-09-28 21:12:56 UTC
Created attachment 55895 [details]
Line 619 in opac-search.pl
Comment 18 Katrin Fischer 2016-10-16 13:17:34 UTC
Hi Claudio,
I tried to make your comment into a patch, but it seems like the grouping is broken on master? Not sure where my mistake is. I added BK into a group IGROUP. The search from advanced search brings up nothing - the facets don't show the group term but the normal itemtype description.
Comment 19 Claudio Costales 2016-10-16 15:35:06 UTC
Created attachment 56573 [details]
Error sample

Katrin, please see file attached. I hope this help...
Comment 20 Katrin Fischer 2017-01-17 23:46:21 UTC
There are some issues with this feature, but I think we can still try and fix the issue Claudio reported. When testing this, make sure that you use the search on the itemtype group together with another search criteria (see bug 175319

To test:
- add items for at least 2 itemtypes
- create an authorised_value for ITEMTYPECAT
- assign your used itemtypes to that category in administration > itemtypes
- search for items in combination with another search criteria (title or whatever)
- verify that the facet description for item tpyes is not correct
Comment 21 Claudio Costales 2017-01-18 00:15:50 UTC
Hi Katrin!

I attached a PDF with a test about this bug (item type descriptions). It is running in a production environment of mine and works fine.

If you agree I can sign this bug off.
Comment 22 Claudio Costales 2017-01-18 00:17:27 UTC
Created attachment 59123 [details]
Item type description in OPAC search
Comment 23 Katrin Fischer 2017-01-18 00:19:45 UTC
Hi Claudio, first we need a patch :) Would you be able to provide one? I have added the 'Academy' keyword, as there are some students working on bugs at Catalyst IT in NZ this week, but not sure if they will get to take a look at it.
Comment 24 Claudio Costales 2017-01-18 10:53:32 UTC
Line 614 in /usr/share/koha/opac/cgi-bin/opac/opac-search.pl:


        ($error, $results_hashref, $facets) = $searcher->search_compat($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,undef,$itemtypes,$query_type,$scan,1);


 should be replaced by this:

        ($error, $results_hashref, $facets) = $searcher->search_compat($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,undef,$itemtypes_nocategory,$query_type,$scan,1);




======
Tested in 16.11.01
Comment 25 Emma 2017-01-18 21:45:40 UTC
Created attachment 59182 [details] [review]
Bug 17134: Replace item types codes with category

To test:
-Search in OPAC for two or more items
-Note that item types display category codes rather than names
-Make change to file and test in OPAC
Comment 26 Claudio Costales 2017-01-21 13:37:00 UTC
I have already tested it in 2 production installations and in a local development one. 

May I sign-off this bug?
Comment 27 Owen Leonard 2017-01-24 15:03:14 UTC
Created attachment 59504 [details] [review]
[SIGNED-OFF] Bug 17134: Replace item types codes with category

To test:
-Search in OPAC for two or more items
-Note that item types display category codes rather than names
-Make change to file and test in OPAC

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 28 Jonathan Druart 2017-01-26 10:41:48 UTC
It seems that this has been introduced by bug 12478.
Comment 29 Jonathan Druart 2017-01-26 10:44:06 UTC
Created attachment 59572 [details] [review]
Bug 17134: Replace item types codes with category in facets (opac)

To test:
-Search in OPAC for two or more items
-Note that item types display category codes rather than names
-Make change to file and test in OPAC

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 30 Kyle M Hall 2017-02-14 13:56:07 UTC
Pushed to master for 17.05, thanks Emma!
Comment 31 Katrin Fischer 2017-02-14 19:38:51 UTC
This patch has been pushed to 16.11.x and will be in 16.11.04.

At last :)