Bug 16485 - Collection column in Item search is always empty
Summary: Collection column in Item search is always empty
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Marc Véron
QA Contact: Julian Maurice
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-10 11:03 UTC by Theodoros Theodoropoulos
Modified: 2019-10-14 19:56 UTC (History)
9 users (show)

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


Attachments
Showing Z39.50 search results with and without MarcEdit XSLT applied (189.25 KB, image/png)
2016-07-12 18:22 UTC, Andy Boze
Details
Bug 16485: collection column in Item search is always empty (2.76 KB, patch)
2017-06-27 17:02 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16485: collection column in Item search is always empty (2.83 KB, patch)
2017-08-01 13:06 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16485: collection column in Item search is always empty (2.87 KB, patch)
2017-08-28 12:48 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 16485: collection column in Item search is always empty (2.94 KB, patch)
2017-09-01 12:55 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Theodoros Theodoropoulos 2016-05-10 11:03:55 UTC
When in "Item Search", it seems that regardless of the items returned in the result set, the collection name is always empty.

This should be fixed and have the collection name displayed as expected.

(The issue appears in 3.20, but seems to exists in 3.22 as well...)
Comment 1 Theodoros Theodoropoulos 2016-05-10 11:06:47 UTC
Needless to say that in my case the authorized values for the collections are correct and collection names appear correctly in other result pages.
Comment 2 Jonathan Druart 2016-05-11 11:28:25 UTC
Hi Theodoros,
It seems to be related to the field biblioitems.collectiontitle which is only used by UNIMARC users.
Julian, could you confirm?
Comment 3 Julian Maurice 2016-05-11 14:33:28 UTC
I confirm that the "Collection" column display data from biblioitems.collectiontitle. I don't know if it's specific to UNIMARC users.
Comment 4 Owen Leonard 2016-05-11 14:43:18 UTC
(In reply to Julian Maurice from comment #3)
> I don't know if it's specific to UNIMARC users.

It's all NULL in our MARC21 database, for what it's worth.
Comment 5 Theodoros Theodoropoulos 2016-05-11 14:45:51 UTC
Also In our MARC21 system, ALL ~1m items have NULL in biblioitems.collectiontitle
Comment 6 Andy Boze 2016-07-12 18:22:06 UTC Comment hidden (obsolete)
Comment 7 Andy Boze 2016-07-12 18:24:49 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2016-07-12 18:26:14 UTC Comment hidden (obsolete)
Comment 9 Sophie MEYNIEUX 2016-08-19 12:28:43 UTC
It seems there is a confusion between Collection code and collection title.
Collection code is selected as filter, but only collection title appear in results display.
Both column should appear.
Comment 10 Katrin Fischer 2016-10-16 13:29:27 UTC
Suggestion: we only show collectiontitle for UNIMARC or we change the name of the column to be clear it's not the collection from the item. I'd prefer the first a bit, and also, to show hte real collection in the search. It's an important item information and missing at the moment.
Comment 11 Marc Véron 2017-06-27 17:02:21 UTC
Created attachment 64682 [details] [review]
Bug 16485: collection column in Item search is always empty

This patch fills the column 'Collection' in item search from the item values.

To test:
- Go to item search
- Reproduce issue from initial comment
- Apply patch
- Verify that the column 'Collection' is filled

Still to do, but outside of my datatable skills:
Filter by drop down in the column header does a substring search.
Example: Filter for 'Fiction" returns both 'Fiction' and 'Non-fiction' items.
Comment 12 Marc Véron 2017-06-27 17:05:21 UTC
Setting to NSO to get comments.

If somebody wants to take over (for the datatable filter issue) please feel free to do so.
Comment 13 Marc Véron 2017-07-20 07:58:22 UTC
(In reply to Marc Véron from comment #12)
> Setting to NSO to get comments.
> 
> If somebody wants to take over (for the datatable filter issue) please feel
> free to do so.

Regarding the filter problem:

jQuery DataTable ColumnFilter plugin. Can the “select” filter style support exact match?
https://stackoverflow.com/questions/9520423/jquery-datatable-columnfilter-plugin-can-the-select-filter-style-support-exac

I opened a new bug for that, because other datatable columns with filters of type select are affected as well:

Bug 18961 - Datatable column filters of style 'select' should do an exact match
Comment 14 Marc Véron 2017-07-20 08:00:46 UTC
BTW, patch still applies...
Comment 15 Owen Leonard 2017-08-01 13:06:51 UTC
Created attachment 65395 [details] [review]
[SIGNED-OFF] Bug 16485: collection column in Item search is always empty

This patch fills the column 'Collection' in item search from the item values.

To test:
- Go to item search
- Reproduce issue from initial comment
- Apply patch
- Verify that the column 'Collection' is filled

Still to do, but outside of my datatable skills:
Filter by drop down in the column header does a substring search.
Example: Filter for 'Fiction" returns both 'Fiction' and 'Non-fiction' items.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 16 Owen Leonard 2017-08-01 13:09:09 UTC
This solution works well for me as a MARC21 user. I agree that a separate bug is the right place for the matching issue.

Since this changes the way the search works for UNIMARC users I think it would be good to get an additional signoff from someone who can test with UNIMARC data.
Comment 17 Biblibre Sandboxes 2017-08-28 12:48:11 UTC
Patch tested with a sandbox, by Laurence Rault <laurence.rault@biblibre.com>
Comment 18 Biblibre Sandboxes 2017-08-28 12:48:33 UTC
Created attachment 66553 [details] [review]
Bug 16485: collection column in Item search is always empty

This patch fills the column 'Collection' in item search from the item values.

To test:
- Go to item search
- Reproduce issue from initial comment
- Apply patch
- Verify that the column 'Collection' is filled

Still to do, but outside of my datatable skills:
Filter by drop down in the column header does a substring search.
Example: Filter for 'Fiction" returns both 'Fiction' and 'Non-fiction' items.

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

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Comment 19 Laurence Rault 2017-08-28 12:50:35 UTC
Tested OK on sandbox with UNIMARC configuration ; with the patch the items.ccode is displayed in column Collection
Comment 20 Julian Maurice 2017-09-01 12:55:34 UTC
Created attachment 66729 [details] [review]
Bug 16485: collection column in Item search is always empty

This patch fills the column 'Collection' in item search from the item values.

To test:
- Go to item search
- Reproduce issue from initial comment
- Apply patch
- Verify that the column 'Collection' is filled

Still to do, but outside of my datatable skills:
Filter by drop down in the column header does a substring search.
Example: Filter for 'Fiction" returns both 'Fiction' and 'Non-fiction' items.

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

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 21 Jonathan Druart 2017-09-01 16:04:20 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 22 Fridolin Somers 2017-10-03 09:26:49 UTC
Pushed to 17.05.x, will be in 17.05.05.
Comment 23 Theodoros Theodoropoulos 2017-10-03 09:48:52 UTC
Thank you all for your time and effort into fixing this bug!
FYI, the patch seems to work fine (with a small offset), even in older, non-maintained Koha versions (ie 3.2x)


ps. A further update would be to consider populating the dropdown menu with the CCODES of the results ONLY instead of all the CCODES, but for the time being I think this is impossible.
Comment 24 Katrin Fischer 2017-10-06 06:08:56 UTC
This patch has been pushed to 16.11.x and will be in 16.11.13.
Comment 25 Mason James 2017-11-23 23:08:29 UTC
Pushed to 16.05.x, for 16.05.18 release