Bug 37057 - OPACShowUnusedAuthorities displays unused authorities regardless
Summary: OPACShowUnusedAuthorities displays unused authorities regardless
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: 23.11
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Martin Renvoize
URL:
Keywords: regression
Depends on: 12478
Blocks:
  Show dependency treegraph
 
Reported: 2024-06-07 17:44 UTC by Esther Melander
Modified: 2024-07-25 11:23 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:
24.11.00
Circulation function:


Attachments
Bug 37057: Restore filtering of unused authorities (2.04 KB, patch)
2024-06-11 12:37 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37057: Restore filtering of unused authorities (2.09 KB, patch)
2024-06-13 23:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 37057: Restore filtering of unused authorities (2.15 KB, patch)
2024-06-28 15:53 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Esther Melander 2024-06-07 17:44:38 UTC
To replicate:

1. Create a topic term authority "Example"
2. Duplicate that authority so there are two
3. Find a record and add the topical term "Example"
4. Link the topical term in the record to one of the two Example authorities.
5. Set OPACShowUnusedAuthorities to show.
6. Ensure OpacAuthorities is set to Allow.
7. Search Authorities in the OPAC for "Example"

A list should be returned with Example listed twice. One of the authorities should display it is linked to a record and one should be "0" for no link.

8. Change OPACShowUnusedAuthorities to don't show
9. Refresh the page and repeat the authority search for "Example"

See that the search results are identical. The Example result with no linked records still displays. I would have expected it to not display, unless there is some other preference or option that needs to be set.
Comment 1 Phil Ringnalda 2024-06-10 17:25:54 UTC
That would be from bug 12478 in https://git.koha-community.org/Koha-community/Koha/commit/0002bbc72a42b4c4223e20c66ef032c20f48ba19 - apparently at one point, Elasticsearch hadn't yet implemented authority usage counts, so they just commented out the whole OPACShowUnusedAuthorities feature for ES and Zebra, and left it that way.
Comment 2 Nick Clemens (kidclamp) 2024-06-11 12:37:29 UTC
Created attachment 167629 [details] [review]
Bug 37057: Restore filtering of unused authorities

Bug 12478 commented this code out, however, we do return the 'used' parameter in ES authority searches. While
we should implement the feature for both ES and Zebra as an index, we can restore this behaviour here.

To test:
1 - Search authorities on OPAC with SearchEngine syspref set to both Elasticsearch and Zebra
    I just searched for 'a'
2 - Confirm results with no usage are included
3 - Test with both values of OPACShowUnusedAuthorities
4 - Apply patch
5 - Repeat searches with both engines and syspref settings
6 - Confirm unused authorities not shown in either engine when syspref is "Don't show"
7 - Conifrm unused authorities shown in both engines when syspref is "Show"
Comment 3 David Nind 2024-06-13 23:05:05 UTC
Created attachment 167705 [details] [review]
Bug 37057: Restore filtering of unused authorities

Bug 12478 commented this code out, however, we do return the 'used' parameter in ES authority searches. While
we should implement the feature for both ES and Zebra as an index, we can restore this behaviour here.

To test:
1 - Search authorities on OPAC with SearchEngine syspref set to both Elasticsearch and Zebra
    I just searched for 'a'
2 - Confirm results with no usage are included
3 - Test with both values of OPACShowUnusedAuthorities
4 - Apply patch
5 - Repeat searches with both engines and syspref settings
6 - Confirm unused authorities not shown in either engine when syspref is "Don't show"
7 - Conifrm unused authorities shown in both engines when syspref is "Show"

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2024-06-13 23:17:24 UTC
Testing notes (using KTD):

1. I used the word 'central' to show used and unused terms on the search results.

2. The pagination for OPAC authority search results is currently not working (not because of this bug). If you try and navigate to the next page of results, it just returns you to the authority search form. I have logged Bug 37086 for this.
Comment 5 Martin Renvoize 2024-06-28 15:53:02 UTC
Created attachment 168271 [details] [review]
Bug 37057: Restore filtering of unused authorities

Bug 12478 commented this code out, however, we do return the 'used' parameter in ES authority searches. While
we should implement the feature for both ES and Zebra as an index, we can restore this behaviour here.

To test:
1 - Search authorities on OPAC with SearchEngine syspref set to both Elasticsearch and Zebra
    I just searched for 'a'
2 - Confirm results with no usage are included
3 - Test with both values of OPACShowUnusedAuthorities
4 - Apply patch
5 - Repeat searches with both engines and syspref settings
6 - Confirm unused authorities not shown in either engine when syspref is "Don't show"
7 - Conifrm unused authorities shown in both engines when syspref is "Show"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2024-06-28 15:53:28 UTC
Thanks for the quick fix Nick.. all working as expected again now.

Passing QA
Comment 7 Katrin Fischer 2024-07-01 16:58:40 UTC
Pushed for 24.11!

Well done everyone, thank you!