The patron search has a redirect built in to send you directly to the patron if there is only a single result from your search. This is also triggered, however, when a later page has only 1 result To recreate: 1 - Perform a patron search that returns 41 results, on Koha testing docker, 'a' works 2 - Go to second page of results, works 3 - Go to third page of results, redirected to the patron
Created attachment 130564 [details] [review] Bug 30098: ONly redirect from patron search if single result is on first page This patch simply adds a check that we are oin the first page (starting at result 0) before redirecting to a isngle patron To test: 1 - Perform a patron search that returns 41 results, on Koha testing docker, 'a' works 2 - Go to second page of results, works 3 - Go to third page of results, redirected to the patron 4 - Apply patch 5 - Repeat search and paging 6 - On third page you remian in results and are not redirected to patron
Created attachment 130626 [details] [review] Bug 30098: ONly redirect from patron search if single result is on first page This patch simply adds a check that we are oin the first page (starting at result 0) before redirecting to a isngle patron To test: 1 - Perform a patron search that returns 41 results, on Koha testing docker, 'a' works 2 - Go to second page of results, works 3 - Go to third page of results, redirected to the patron 4 - Apply patch 5 - Repeat search and paging 6 - On third page you remian in results and are not redirected to patron Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
I've fixed that on by 30063 by testing json.iTotalDisplayRecords == 1, I think it's the correct way to do.
Created attachment 131191 [details] [review] Bug 30098: Only redirect from patron search if single result is on first page This patch simply adds a check that we are oin the first page (starting at result 0) before redirecting to a isngle patron To test: 1 - Perform a patron search that returns 41 results, on Koha testing docker, 'a' works 2 - Go to second page of results, works 3 - Go to third page of results, redirected to the patron 4 - Apply patch 5 - Repeat search and paging 6 - On third page you remian in results and are not redirected to patron Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Hmm, just read Jonathans comment.. I think he's right, that's a slightly cleaner solution with one less test. I'll PQA as there's not real issue with this code and leave it to the RM to decide which of the two options is 'nicest'... we can always have the solution from bug 30063 once that's worked it's way through anyway. PQA
Mmmm tiny patch and it works, I push and send my best wishes to Bug 30063
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
Pushed to 21.11.x for 21.11.04
Pushed to 21.05.x for 21.05.13
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.
This does not work. There is no redirect if only 1 patron is returned.
(In reply to Jonathan Druart from comment #11) > This does not work. There is no redirect if only 1 patron is returned. Oh crap ! We did not saw this. I've opened Bug 30325. The fix from comment 3 looks perfect. Lets validate it fast for this month release.
(In reply to Andrew Fuerste-Henry from comment #9) > Pushed to 21.05.x for 21.05.13 I've reverted this in 21.05.x, it is no longer backported.
(In reply to Andrew Fuerste-Henry from comment #13) > (In reply to Andrew Fuerste-Henry from comment #9) > > Pushed to 21.05.x for 21.05.13 > > I've reverted this in 21.05.x, it is no longer backported. I think you should pick bug 30325 then.