Koha/catalogue
Fridolin Somers 3bb7ea2dab
Bug 33569: Fix sort by relevance in catalog search
When ordering catalog search by relevance from advanced search, this is not visible in sort order combobox in staff interface.

This is because sort by relevance is a special case not using sort
order.
This patch add a new method C4::Context->default_catalog_sort_by to use
in both staff interface and OPAC.

Test plan :
1.0) On staff interface
1.1) Define system preferences defaultSortField = 'relevance' and defaultSortOrder = 'descending'
1.2) Perform a catalog search from main page on any term, ie 'perl'
=> You see in sort combobox 'relevance' selected (with a check icon)
1.3) Perform an advanced search on any term, ie 'perl', with sort by relevance
=> Without patch : you see in sort combobox 'relevance' not selected (no check icon)
=> With patch : you see in sort combobox 'relevance' selected (with a check icon)
2.0) On OPAC
2.1) Define system preferences OPACdefaultSortField = 'relevance' and OPACdefaultSortOrder = 'descending'
2.2) Perform a catalog search from main page on any term, ie 'perl'
=> You see in sort combobox 'relevance' selected
3.0) Run prove t/Context.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-05-09 11:46:47 -03:00
..
detail.pl Bug 33070: Remove use of can_edit_items 2023-03-17 09:59:02 -03:00
export.pl
getitem-ajax.pl
image.pl
imageviewer.pl Bug 31310: Remove GetItemsInfo from catalogue/imageviewer 2022-08-16 09:22:47 -03:00
ISBDdetail.pl
issuehistory.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
item-export.pl Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
itemsearch.pl Bug 20256: Use new methods 2023-02-02 11:59:26 -03:00
labeledMARCdetail.pl Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
MARCdetail.pl
moredetail.pl Bug 33070: Remove use of can_edit_items 2023-03-17 09:59:02 -03:00
search-history.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
search.pl Bug 33569: Fix sort by relevance in catalog search 2023-05-09 11:46:47 -03:00
showelastic.pl Bug 18829: (QA follow-up) Replace forbidden indirect syntax 2023-04-17 09:39:42 -03:00
showmarc.pl
stockrotation.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
updateitem.pl