Bugzilla – Attachment 119122 Details for
Bug 28074
Browse controls on staff detail pages are sometimes weird
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28074: Make current_search.offset an integer instead of string
Bug-28074-Make-currentsearchoffset-an-integer-inst.patch (text/plain), 3.82 KB, created by
Owen Leonard
on 2021-04-02 13:22:15 UTC
(
hide
)
Description:
Bug 28074: Make current_search.offset an integer instead of string
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-04-02 13:22:15 UTC
Size:
3.82 KB
patch
obsolete
>From 77ba76956d6cc038a65a60eb75662f1f588fba51 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 1 Apr 2021 22:51:07 +0000 >Subject: [PATCH] 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> >--- > koha-tmpl/intranet-tmpl/js/browser.js | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/js/browser.js b/koha-tmpl/intranet-tmpl/js/browser.js >index 9ab1ab586a..19d707376e 100644 >--- a/koha-tmpl/intranet-tmpl/js/browser.js >+++ b/koha-tmpl/intranet-tmpl/js/browser.js >@@ -42,9 +42,9 @@ KOHA.browser = function (searchid, biblionumber) { > > me.create = function (offset, query, limit, sort, newresults, total) { > if (current_search) { >- if (offset === current_search.offset - newresults.length) { >+ if (offset === parseInt(current_search.offset) - newresults.length) { > current_search.results = newresults.concat(current_search.results); >- } else if (searchOffset = current_search.offset + newresults.length) { >+ } else if (searchOffset = parseInt(current_search.offset) + newresults.length) { > current_search.results = current_search.results.concat(newresults); > } else { > delete current_search; >@@ -73,10 +73,10 @@ KOHA.browser = function (searchid, biblionumber) { > me.show = function () { > if (current_search) { > me.curPos = $.inArray(biblionumber, current_search.results); >- if ( current_search.offset + me.curPos <= current_search.pagelen ) { // First page >+ if ( parseInt(current_search.offset ) + me.curPos <= current_search.pagelen ) { // First page > me.offset = 0; > } else { >- me.offset = current_search.offset - 1; >+ me.offset = parseInt(current_search.offset) - 1; > } > > $(document).ready(function () { >@@ -84,12 +84,12 @@ KOHA.browser = function (searchid, biblionumber) { > var searchURL = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(current_search.query) + '&limit=' + decodeURIComponent(current_search.limit) + '&sort_by=' + current_search.sort + '&searchid=' + me.searchid + '&offset=' + me.offset; > var prevbutton; > var nextbutton; >- if (me.curPos === 0 && current_search.offset === 1) { >+ if (me.curPos === 0 && parseInt(current_search.offset) === 1) { > prevbutton = '<span id="browse-previous" class="browse-button" title="' + __("Previous") + '"><i class="fa fa-arrow-left"></i></span>'; > } else { > prevbutton = '<a href="#" id="browse-previous" class="browse-button" title="' + __("Previous") + '"><i class="fa fa-arrow-left"></i></a>'; > } >- if (current_search.offset + me.curPos == current_search.total) { >+ if (parseInt(current_search.offset) + me.curPos == current_search.total) { > nextbutton = '<span id="browse-next" class="browse-button" title="' + __("Next") + '"><i class="fa fa-arrow-right"></i></span>'; > } else { > nextbutton = '<a href="#" id="browse-next" class="browse-button" title="' + __("Next") + '"><i class="fa fa-arrow-right"></i></a>'; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28074
:
119090
|
119122
|
119154