To test: - Do a search in the staff client returning 2-3 results - Open the first result - Click on the "back to results" link on the left - Verify that the link is wrong/not working In my case I searched for "test" in the sample data, it returned 3 records. The search link back to results looks like this: http://localhost:8081/cgi-bin/koha/catalogue/search.pl?idx=kw&q=test&sort_by=relevance_dsc&searchid=scs_1599932246462&offset=9 The offset=9 is the issue and clearly wrong.
We've seen this too, it happens only in the staff interface. It works for some records, and not others, consistently. With a list of search results, clicking on a title takes us to the bib record as expected, but when we click results to go back to the list, we get a blank results page. No error message, but no titles listed. If we sort the results list, the titles appear. As I said above, it only happens to certain records, which led me to suspect there's a problem in the MARC somewhere. Experimenting with one of them, I've tried the following: 1) Checked the record in MarcEdit - it didn't flag up any problems. 2) Replaced the offending record with a Z39.50 download from LC 3) Deleted the record and re-catalogued it using a template that we have. 4) Catalogued it completely from scratch - without a template (the template has the same problem!). No change. We still get the blank results page.
I think it might be related to short result lists and a wrong calculation of the offset parameter. The offset defines where in the list we return to (the page... the result number), but for my result list of 3 it shows 9 - which makes a jump behind the existing results - blank page.
I don't think the list length makes a difference. From the last record in a list of 1987 records, we get offset=195101 Other interesting behaviours from this long list. It seems like records in the first few pages of results work, but when you go back to results, it advances to the next page of results. If the record is on the first page of results, going back to results lands you on the second page of results and so on. Records towards the end of the list give a blank page. It's almost as if something is increasing the number of records the system is trying to retrieve. In a long list, some will work, but eventually it starts looking for more records than are in the results. There be dragons!
Created attachment 111684 [details] [review] Bug 26445: Fix "back to result" link of the search result browser Not sure what was the expected behaviour, I am suggesting the following one: If you are browsing and you click "back to result", you will be redirected to the page where the record appear on the search result list. Say you search for "something" that returns 10 page (20 results per page) Click on first result first page Click back to result => You see the first page with the first result at the top Click on second page, 3rd result Click back to result => You see the second page with the biblio you clicked at the 3rd position Click on second page, 3rd result Click next/previous Click back to result => You see the page where you last result were. I think the existing expected behaviour was to have the result you clicked at the first position of the result page, but I am not sure it really makes sense. Hope this makes sense however!
Has this been always been broken or it's a regression?
I believe it is a regression as I have used the link in past versions, but it might have been broken for quite a long while.
Created attachment 111861 [details] [review] Bug 26445: Fix "back to result" link of the search result browser Not sure what was the expected behaviour, I am suggesting the following one: If you are browsing and you click "back to result", you will be redirected to the page where the record appear on the search result list. Say you search for "something" that returns 10 page (20 results per page) Click on first result first page Click back to result => You see the first page with the first result at the top Click on second page, 3rd result Click back to result => You see the second page with the biblio you clicked at the 3rd position Click on second page, 3rd result Click next/previous Click back to result => You see the page where you last result were. I think the existing expected behaviour was to have the result you clicked at the first position of the result page, but I am not sure it really makes sense. Hope this makes sense however! Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 111877 [details] [review] Bug 26445: Fix "back to result" link of the search result browser Not sure what was the expected behaviour, I am suggesting the following one: If you are browsing and you click "back to result", you will be redirected to the page where the record appear on the search result list. Say you search for "something" that returns 10 page (20 results per page) Click on first result first page Click back to result => You see the first page with the first result at the top Click on second page, 3rd result Click back to result => You see the second page with the biblio you clicked at the 3rd position Click on second page, 3rd result Click next/previous Click back to result => You see the page where you last result were. I think the existing expected behaviour was to have the result you clicked at the first position of the result page, but I am not sure it really makes sense. Hope this makes sense however! Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Works as expected and code makes sense.. Passing QA
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.06
i can't reproduce this in 19.11.x. not backported