At the present, the sort preference applied to a list of results in the staff client is not remembered when the user returns to the result list after viewing a record. Ideally, clicking on the button to return to the result list should remember the sort preference selected prior to viewing a record. Steps to replicate: 1. Have Elasticsearch enabled 2. Perform a search in the staff client 3. Change the sort order to something different (try Author A-Z) 4. Click on a result to view the record 5. Click on "Results" button on left side to return to result list 6. Note that the result list is sorted by relevancy again and not call number Note: On master, the OPAC remembers sort order in both the "browse results" and "back to results" link.
This impacts both Zebra and Elasticsearch
Created attachment 96359 [details] [review] Bug 24219: Preserve sort order when returning to result list There is a mismatch between sort_cgi, sort and sort_by variables. * sort_cgi I did not find relevant occurrences of sort_cgi in the git log of both search.pl and results.tt. So it seems that it never worked correctly. * sort It is the JS variable use in browser.js * sort_by is the search.pl parameter to set the sort_by option Test plan: 1. Perform a search in the staff client 2. Change the sort order to something different (try Author A-Z) 3. Click on a result to view the record 4. Click on "Results" button on left side to return to result list => Without this patch the result list is sorted by relevancy => With this patch applied the Author A-Z is kept
Created attachment 96390 [details] [review] Bug 24219: Preserve sort order when returning to result list There is a mismatch between sort_cgi, sort and sort_by variables. * sort_cgi I did not find relevant occurrences of sort_cgi in the git log of both search.pl and results.tt. So it seems that it never worked correctly. * sort It is the JS variable use in browser.js * sort_by is the search.pl parameter to set the sort_by option Test plan: 1. Perform a search in the staff client 2. Change the sort order to something different (try Author A-Z) 3. Click on a result to view the record 4. Click on "Results" button on left side to return to result list => Without this patch the result list is sorted by relevancy => With this patch applied the Author A-Z is kept Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Sorry Jonathan, this one needs a rebase.
Created attachment 99512 [details] [review] Bug 24219: Preserve sort order when returning to result list There is a mismatch between sort_cgi, sort and sort_by variables. * sort_cgi I did not find relevant occurrences of sort_cgi in the git log of both search.pl and results.tt. So it seems that it never worked correctly. * sort It is the JS variable use in browser.js * sort_by is the search.pl parameter to set the sort_by option Test plan: 1. Perform a search in the staff client 2. Change the sort order to something different (try Author A-Z) 3. Click on a result to view the record 4. Click on "Results" button on left side to return to result list => Without this patch the result list is sorted by relevancy => With this patch applied the Author A-Z is kept
Created attachment 99847 [details] [review] Bug 24219: Preserve sort order when returning to result list There is a mismatch between sort_cgi, sort and sort_by variables. * sort_cgi I did not find relevant occurrences of sort_cgi in the git log of both search.pl and results.tt. So it seems that it never worked correctly. * sort It is the JS variable use in browser.js * sort_by is the search.pl parameter to set the sort_by option Test plan: 1. Perform a search in the staff client 2. Change the sort order to something different (try Author A-Z) 3. Click on a result to view the record 4. Click on "Results" button on left side to return to result list => Without this patch the result list is sorted by relevancy => With this patch applied the Author A-Z is kept Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 100266 [details] [review] Bug 24219: Preserve sort order when returning to result list There is a mismatch between sort_cgi, sort and sort_by variables. * sort_cgi I did not find relevant occurrences of sort_cgi in the git log of both search.pl and results.tt. So it seems that it never worked correctly. * sort It is the JS variable use in browser.js * sort_by is the search.pl parameter to set the sort_by option Test plan: 1. Perform a search in the staff client 2. Change the sort order to something different (try Author A-Z) 3. Click on a result to view the record 4. Click on "Results" button on left side to return to result list => Without this patch the result list is sorted by relevancy => With this patch applied the Author A-Z is kept Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nice work everyone! Pushed to master for 20.05
does not apply to 19.11.x branch. please rebase if needed.