The browse control feature doesn't work quite right in the OPAC detail. 1. If you do a search with 3-4 results, go to the record and use the browse controls, when you get to the last record if you attempt to go to the 'next' you'll end up on a page which says 'record not found'. 2. Do a search with exactly 10 results. Click on the first record, the 'next' arrow is not a link, you cannot move to the next result. This is because in js/browser.js, if you look at the current_search Object and specifically at current_search.offset you will see that current_search.offset is a string. We try to do calculations with that variable and JavaScript performs string concatenation instead of addtion. For example: current_search.offset + me.curPos == current_search.total When the offset is '1' and we add it to 0, the result is 10. Therefore if the offset is the first and the total is 10, it thinks we are on the last result (10) and doesn't let use move forward. Converting current_search.offset to an integer solves the problem.
When I said OPAC detail, I meant staff detail
Created attachment 119090 [details] [review] Bug 28074: Make current_search.offset an integer instead of string To test: 1. do a search with 3-4 results, go to the record and use the browse controls, when you get to the last record if you attempt to go to the 'next' you'll end up on a page which says 'record not found'.2. Do a search with exactly 10 results. Click on the first record, the 'next' arrow is not a link, you cannot move to the next result 3. Apply patch 4. repeat steps 1-2 and the problems should be gone
Created attachment 119122 [details] [review] Bug 28074: Make current_search.offset an integer instead of string To test: 1. Do a search with 3-4 results, go to the record and use the browse controls, when you get to the last record if you attempt to go to the 'next' you'll end up on a page which says 'record not found.' 2. Do a search with exactly 10 results. Click on the first record, the 'next' arrow is not a link, you cannot move to the next result. 3. Apply patch 4. Repeat steps 1-2 and the problems should be gone. Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 119154 [details] [review] Bug 28074: Make current_search.offset an integer instead of string To test: 1. Do a search with 3-4 results, go to the record and use the browse controls, when you get to the last record if you attempt to go to the 'next' you'll end up on a page which says 'record not found.' 2. Do a search with exactly 10 results. Click on the first record, the 'next' arrow is not a link, you cannot move to the next result. 3. Apply patch 4. Repeat steps 1-2 and the problems should be gone. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.05
Pushed to 20.05.x for 20.05.11
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.