From 3d23287e875c42f5dd4ede1d778f504be976d21b Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Mon, 13 May 2024 01:00:41 +0000 Subject: [PATCH] Bug 36660: Make Authorities 'see from' searches 'exact' This enhancement changes the search URL for 'see from' headings to look for an 'exact' match. When using a 'see from' heading, when Koha does a 'contains' search this is quite general and may fetch a bunch of unexpected results. This enhancement also changes the OPAC authority search to search on all headings when doing a 'see from' search, so the results mirror that on the staff interface. Also important if subheading info is stored in the $x or other subfields, for example. To test (assume using KTD): 1) In the staff interface, add a new topical term authority. Set the following values: 150$a: Quests 550$a: Travel 2) Add a second topical term authority, this is one we DON'T want showing in 'see from' results. Set the following values: 150$a: Cheques 550$a: Travellers' cheques 3) Do a 'main heading ($a only)' search for 'Quests'. Your new heading should show in the results, with 'Travel' showing as a see from searchable link. 4) Click the 'Travel' search link. Notice you get a few results, including the 'Cheques' heading which we don't want to show. 5) Follow steps 3 & 4 on the OPAC. Notice you get a few results, but your 'Quests' heading doesn't even show, which you may expect it to. 6) Apply the patch and restart services. 7) In the staff interface, go back to the Authorities homepage. 8) Repeat steps 3 & 4. Confirm you get the expected 'Quests' heading in the results, and do not get the 'Cheques' heading. 9) Repeat steps 3 & 4 on the OPAC. Confirm you get the expected 'Quests' heading in the results, and do not get the 'Cheques' heading. Sponsored-by: Education Services Australia SCIS Signed-off-by: Lucas Gass --- .../prog/en/includes/authorities-search-results.inc | 2 +- .../bootstrap/en/includes/authorities-search-results.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc index 74f6e72fd0..b315fc6e4e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc @@ -6,7 +6,7 @@ [%# authid: if it is a linked authority, its authid %] [% SET authidurl = '/cgi-bin/koha/authorities/detail.pl?authid=' %] - [% SET searchurl = '/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=any&operator=contains&orderby=HeadingAsc&value=' %] + [% SET searchurl = '/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&marclist=any&operator=exact&orderby=HeadingAsc&value=' %] [% IF marcflavour == 'UNIMARC' %] [% IF authid %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/authorities-search-results.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/authorities-search-results.inc index 305a0bc3cc..56e285317b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/authorities-search-results.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/authorities-search-results.inc @@ -6,7 +6,7 @@ [%# authid: if it is a linked authority, its authid %] [% SET authidurl = '/cgi-bin/koha/opac-authoritiesdetail.pl?authid=' %] - [% SET searchurl = '/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operator=contains&marclist=mainentry&and_or=and&orderby=HeadingAsc&value=' %] + [% SET searchurl = '/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operator=exact&marclist=any&and_or=and&orderby=HeadingAsc&value=' %] [% IF marcflavour == 'UNIMARC' %] [% SWITCH type %] [% CASE 'broader' %] -- 2.39.2