Created attachment 144096 [details] Sort by option in Staff Client Advanced Search The defaultSortField system preference doesn't seem to affect the Staff Client Advanced Search, it still shows 'relevance' as the sort field whichever option you use in the syspref. However, when you submit the search it does in fact search by the value of the syspref. Need to: - In the advanced search in the staff client, display the correct default "sort by" option that is chosen in the defaultSortField system preference
Sort by option in Staff Client Advanced Search The defaultSortField system preference doesn't seem to affect the Staff Client Advanced Search, it still shows 'relevance' as the sort field whichever option you use in the syspref. However, when you submit the search it does in fact search by the value of the syspref. Need to: - In the advanced search in the staff client, display the correct default "sort by" option that is chosen in the defaultSortField system preference
Confirmed on master. It works nicely in simple search, but not in advanced search: * Set defaultSortField: title * Set defaultSortOrder: A-Z * Do a catalog search for... anything (I used perl) * Sorting is alphabetic and in the sort pull down, the title has a little checkmark in front of the entry (could stand out a little more) * Set defaultSortField: author * Set defaultSortOrder: ascending * Searched for 'perl' again * No author is on top, rest seems to sort ok, C D G... * Checkmark on search shows But on advanced search, the search pull down seems stuck to Relevance no matter what.
Created attachment 144310 [details] [review] Bug 32301: defaultSortField changes the default Sort By in Staff Client Advanced Search Use the system preference "defaultSortField" to choose the default Sort By in the Staff Client Advances Search 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 Sponsored-by: National Institute of Atmospheric and Water Research
Created attachment 144327 [details] [review] Bug 32301: defaultSortField changes the default Sort By in Staff Client Advanced Search Use the system preference "defaultSortField" to choose the default Sort By in the Staff Client Advances Search 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 Sponsored-by: National Institute of Atmospheric and Water Research Signed-off-by: David Nind <david@davidnind.com>
Hi Wainui, I believe this fix is not completely right yet: 1) Do an advanced search, change the sort order from default to something else 2) In the result list click on "edit this search" on top of the results list 3) notice that the sort is kept 4) Apply patch, restart all the things 5) Repeat steps above - sort will be changed back to the default
Hi Katrin I've just re-tested this and believe it does work as described, can you please test again? Thanks Aleisha
(In reply to wainuiwitikapark from comment #3) > Created attachment 144310 [details] [review] [review] > Bug 32301: defaultSortField changes the default Sort By in Staff Client > Advanced Search > > Use the system preference "defaultSortField" to choose the default Sort > By in the Staff Client Advances Search > > 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 > > Sponsored-by: National Institute of Atmospheric and Water Research Works as described. Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Created attachment 147984 [details] [review] Bug 32301: defaultSortField changes the default Sort By in Staff Client Advanced Search Use the system preference "defaultSortField" to choose the default Sort By in the Staff Client Advances Search 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 Sponsored-by: National Institute of Atmospheric and Water Research Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Created attachment 148326 [details] [review] Bug 32301: [alternate] 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
I think Katrin is correct, I provided an alternate patch
Created attachment 148973 [details] [review] Bug 32301: [alternate] 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>
Created attachment 149405 [details] [review] Bug 32301: [alternate] 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>
Thx Nick, this now also works with the "Edit search" as expected.
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
Backported to 22.05.x for upcoming 22.05.13.
This bug is present in 21.11.x, can it please be backported?
applied to 21.11 for 21.11.21