]> git.koha-community.org Git - koha.git/commit
Bug 32301: Fix default search sorting in advanced search when not editing a search
authorNick Clemens <nick@bywatersolutions.com>
Fri, 17 Mar 2023 11:20:31 +0000 (11:20 +0000)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Tue, 23 May 2023 18:43:30 +0000 (20:43 +0200)
commit3985fc7014458c64a83dd71d2aa74a424dc6e1e2
tree9f8710dedef55f7539a87a45b5668e3292e11938
parent03fa06bdcb09e43ada5edb1254ebbab5ed4ec4d3
Bug 32301: Fix default search sorting in advanced search when not editing a search

Bug 22605 changed the sorting to expect the passed parameter from the
previous search, this broke default when the search page was loaded
fresh.

We should simply fallback from the edited search to the default if it is
not set

To test:
1) Go to staff client
2) Go to Advanced Search
3) Notice the default Sort By value is "Relevance"
4) Go to system preferences
5) Go to "defaultSortField"
6) Change the value of the system preference
7) Go back to Advanced Search and refresh the page
8) Notice that there are no changes, the default Sort By is still
"Relevance"
9) Apply patch
10) Notice that changing the system preference now changes the default
Sort By in Advanced Search
11) Perform a search, change the sorting, then edit the search
12) Confirm the correct sorting from the search is preserved

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3489cdca1fd77272deca0ff6bda90e1cc40dddb1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit 38d615959c00a2a4468245e18c1099aaf3455cf0)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 9383c5242dd96597af637d3fc4ea718453900b91)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt