[Koha-bugs] [Bug 28074] New: Browse controls in staff details are sometimes weird
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Fri Apr 2 00:49:03 CEST 2021
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28074
Bug ID: 28074
Summary: Browse controls in staff details are sometimes weird
Change sponsored?: ---
Product: Koha
Version: master
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5 - low
Component: Searching
Assignee: koha-bugs at lists.koha-community.org
Reporter: lucas at bywatersolutions.com
QA Contact: testopia at bugs.koha-community.org
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.
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
More information about the Koha-bugs
mailing list