[Bug 23763] New: Move pagination calculations to a subroutine
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Bug ID: 23763 Summary: Move pagination calculations to a subroutine Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Searching Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Currently we duplicate some code used to build pagination parameters needed for page-numbers.inc, we should make this a subroutine and test it -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18008, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18030 Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 93824 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93824&action=edit Bug 23763: Create a pagination_bar routine To test: prove -v t/Koha/SearchEngine/Search.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 93825 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93825&action=edit Bug 23763: Make search on staff and opac use new routine To test: 1 - Apply patch 2 - Search on staff and opac side 3 - Confirm you can paginate results 4 - Confirm you see 10 pages on pagination if under page 10 5 - Confirm you see 20 pages in pagination if over page 10 6 - Confirm you can go to first or last page -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |Failed QA --- Comment #3 from David Nind <david@davidnind.com> --- I'm getting a fail on running the tests - everything else seems okay: root@bed39bee2cb5:koha(23763)$ prove -v t/Koha/SearchEngine/Search.t t/Koha/SearchEngine/Search.t .. 1..5 # Subtest: pagination_bar tests 1..14 ok 1 - We paginate all hits if less than max_result_window ok 2 - We have hits/hits_to_paginate pages ok 3 - We calculate current page by offset/results_per_page plus 1 ok 4 - Previous page is current offset minus reults per page ok 5 - Next page is current offset plus reults per page ok 6 - Last page is pages minus 1 times reults per page ok 7 - If on first ten pages we only show 10 pages ok 8 - We paginate all hits if less than max_result_window ok 9 - We have hits/hits_to_paginate pages ok 10 - We calculate current page by offset/results_per_page plus 1 ok 11 - Previous page is current offset minus reults per page ok 12 - Next page is current offset plus reults per page ok 13 - Last page is pages minus 1 times reults per page ok 14 - If past first ten pages we show 20 pages ok 1 - pagination_bar tests # Looks like you planned 5 tests but ran 1. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 4/5 subtests Test Summary Report ------------------- t/Koha/SearchEngine/Search.t (Wstat: 65280 Tests: 1 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 5 tests but ran 1. Files=1, Tests=1, 1 wallclock secs ( 0.02 usr 0.00 sys + 0.86 cusr 0.07 csys = 0.95 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93825|0 |1 is obsolete| | --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 114674 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114674&action=edit Bug 23763: Make search on staff and opac use new routine To test: 1 - Apply patch 2 - Search on staff and opac side 3 - Confirm you can paginate results 4 - Confirm you see 10 pages on pagination if under page 10 5 - Confirm you see 20 pages in pagination if over page 10 6 - Confirm you can go to first or last page -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93824|0 |1 is obsolete| | --- Comment #5 from David Nind <david@davidnind.com> --- Created attachment 115720 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115720&action=edit Bug 23763: Create a pagination_bar routine To test: prove -v t/Koha/SearchEngine/Search.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114674|0 |1 is obsolete| | --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 115721 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115721&action=edit Bug 23763: Make search on staff and opac use new routine To test: 1 - Apply patch 2 - Search on staff and opac side 3 - Confirm you can paginate results 4 - Confirm you see 10 pages on pagination if under page 10 5 - Confirm you see 20 pages in pagination if over page 10 6 - Confirm you can go to first or last page Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115720|0 |1 is obsolete| | --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 116475 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116475&action=edit Bug 23763: Create a pagination_bar routine To test: prove -v t/Koha/SearchEngine/Search.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115721|0 |1 is obsolete| | --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 116476 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116476&action=edit Bug 23763: Make search on staff and opac use new routine To test: 1 - Apply patch 2 - Search on staff and opac side 3 - Confirm you can paginate results 4 - Confirm you see 10 pages on pagination if under page 10 5 - Confirm you see 20 pages in pagination if over page 10 6 - Confirm you can go to first or last page Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 116477 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116477&action=edit Bug 23763: (QA follow-up) Add +x to Search.t file permissions Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement moves release notes| |duplicated code for the | |pagination of search | |results in the OPAC and | |staff interface into its | |own routine. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #116475|0 |1 is obsolete| | Attachment #116476|0 |1 is obsolete| | --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 116515 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116515&action=edit Bug 23763: Create a pagination_bar routine To test: prove -v t/Koha/SearchEngine/Search.t Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> JD amended patch: perltidy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 116516 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=116516&action=edit Bug 23763: Make search on staff and opac use new routine To test: 1 - Apply patch 2 - Search on staff and opac side 3 - Confirm you can paginate results 4 - Confirm you see 10 pages on pagination if under page 10 5 - Confirm you see 20 pages in pagination if over page 10 6 - Confirm you can go to first or last page Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> JD amended patch: perltidy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- It would have been good to have a bit more tests as we are not testing all the cases, neither the edge ones. But much better than what we had! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23763 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #14 from Fridolin Somers <fridolin.somers@biblibre.com> --- Enhancement not pushed to 20.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org