[Bug 12261] New: Staff client next/previous links lead to unknown record
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Bug ID: 12261 Summary: Staff client next/previous links lead to unknown record Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: fridolyn.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org When using Staff client next/previous links after a search : If the current record is the last of the results, clicking on "next" will lead to the page of an unknown record with message : The record you requested does not exist (NaN). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |10404 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=11817 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Juhani Seppälä <jseppal@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jseppal@student.uef.fi --- Comment #1 from Juhani Seppälä <jseppal@student.uef.fi> --- Hello, I looked into this issue: if (me.curPos === me.searchCookie.results.length && me.searchCookie.total == me.curPos + me.searchCookie.offset) { nextbutton = '<span id="browse-next" class="browse-button">' + me.curPos + ' ' + me.searchCookie.results.length + ' »</span>'; } else { nextbutton = '<a href="#" id="browse-next" class="browse-button">' + me.curPos + ' ' + me.searchCookie.results.length + ' »</a>'; } To me it looks like an off-by-one issue with searchCookie.results.length. searchCookie.total seems to also be returning undefined leading that if-clause evaluating to false. I'm still pretty new to Koha development and am trying still to get a hold of things - may I propose a fix for this issue? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 --- Comment #2 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- (In reply to Juhani Seppälä from comment #1)
may I propose a fix for this issue? Hello and welcome to Koha. Your fixe will be most welcome.
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 --- Comment #3 from Juhani Seppälä <jseppal@student.uef.fi> --- Created attachment 28882 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28882&action=edit Bug 12261: Staff client next/previous links lead to unknown record When using Staff client next/previous links after a search : If the current record is the last of the results, clicking on "next" will lead to the page of an unknown record with message : The record you requested does not exist (NaN). To test: 1) Do an intranet catalog search that has more than 1 results. 2) Click on the last search result and then click the "Next"-button from the top-left navigation. 3) Confirm that you get thrown to a page with the message: "The record you requested does not exist (NaN).". 4) Apply patch. 5) Repeat steps 1 - 2. 6) Confirm that the navigation button for "Next" is greyed out. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|oleonard@myacpl.org |jseppal@student.uef.fi --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Juhani Seppälä from comment #3)
Created attachment 28882 [details] [review]
Thanks for the patch Juhani! I'm assigning the bug to you (since you submitted a patch) and setting the status of the bug to "Needs signoff" so that the bug shows up in the queue of bugs to be tested. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- Testing in master I get a different buggy behavior than is described in this bug report. 1) Did a search in the staff client which returned a few pages of results. 2) Clicked on the last page of results. 3) Clicked on the last result on the last page. 4) Clicked on the "Next" button. 5) Instead of getting an error, I'm redirected to a record which originally appeared on the first page of the search results returned in step 1. It looks like I'm redirected to the 12th record in particular. I get the same behavior before and after the patch. Tested in FF30 and Chrome 35 on Windows 7. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 --- Comment #6 from Juhani Seppälä <jseppal@student.uef.fi> --- (In reply to Owen Leonard from comment #5)
Testing in master I get a different buggy behavior than is described in this bug report.
1) Did a search in the staff client which returned a few pages of results. 2) Clicked on the last page of results. 3) Clicked on the last result on the last page. 4) Clicked on the "Next" button. 5) Instead of getting an error, I'm redirected to a record which originally appeared on the first page of the search results returned in step 1. It looks like I'm redirected to the 12th record in particular.
I get the same behavior before and after the patch. Tested in FF30 and Chrome 35 on Windows 7.
Ah, yes, sorry. Looks like I didn't properly test the patch with big search results (multi-page). I can take another look at this later - should the status be changed for this bug? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Juhani Seppälä <jseppal@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28882|0 |1 is obsolete| | --- Comment #7 from Juhani Seppälä <jseppal@student.uef.fi> --- Created attachment 28907 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28907&action=edit Bug 12261: Staff client next/previous links lead to unknown record When using Staff client next/previous links after a search : If the current record is the last of the results, clicking on "next" will lead to the page of an unknown record with message : The record you requested does not exist (NaN). To test: 1) Do an intranet catalog search that has more than 1 results. 2) Click on the last search result and then click the "Next"-button from the top-left navigation. 3) Confirm that you get thrown to a page with the message: "The record you requested does not exist (NaN).". 4) Apply patch. 5) Repeat steps 1 - 2. 6) Confirm that the navigation button for "Next" is greyed out. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 --- Comment #8 from Juhani Seppälä <jseppal@student.uef.fi> --- Added small changes anyway - this one works for me on both single-page search results & larger search results. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 --- Comment #9 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 28944 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28944&action=edit [SIGNED-OFF] Bug 12261: Staff client next/previous links lead to unknown record When using Staff client next/previous links after a search : If the current record is the last of the results, clicking on "next" will lead to the page of an unknown record with message : The record you requested does not exist (NaN). To test: 1) Do an intranet catalog search that has more than 1 results. 2) Click on the last search result and then click the "Next"-button from the top-left navigation. 3) Confirm that you get thrown to a page with the message: "The record you requested does not exist (NaN).". 4) Apply patch. 5) Repeat steps 1 - 2. 6) Confirm that the navigation button for "Next" is greyed out. Signed-off-by: Owen Leonard <oleonard@myacpl.org> This patch fixes the problem with last result in both single pages of search results and multiple pages of search results. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28907|0 |1 is obsolete| | Attachment #28944|0 |1 is obsolete| | --- Comment #10 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 29100 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=29100&action=edit Bug 12261: Staff client next/previous links lead to unknown record When using Staff client next/previous links after a search : If the current record is the last of the results, clicking on "next" will lead to the page of an unknown record with message : The record you requested does not exist (NaN). To test: 1) Do an intranet catalog search that has more than 1 results. 2) Click on the last search result and then click the "Next"-button from the top-left navigation. 3) Confirm that you get thrown to a page with the message: "The record you requested does not exist (NaN).". 4) Apply patch. 5) Repeat steps 1 - 2. 6) Confirm that the navigation button for "Next" is greyed out. Signed-off-by: Owen Leonard <oleonard@myacpl.org> This patch fixes the problem with last result in both single pages of search results and multiple pages of search results. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m Severity|minor |normal -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Juhani, and congratulations for your first commit. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gmcharlt@gmail.com --- Comment #12 from Galen Charlton <gmcharlt@gmail.com> --- While evaluating this for inclusion in 3.16.x, I ran into an apparent regression. Consider a search that spans multiple pages in the results list. When I go to last hit in the first page, the next link is disabled. It should instead be active and clicking on it should permit traveling to the first hit on the second page of results. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 --- Comment #13 from Juhani Seppälä <jseppal@student.uef.fi> --- I can reproduce what you've described - a bit embarassing for a first submit. I'm sorry for the headache this gives to anyone. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 --- Comment #14 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Galen Charlton from comment #12)
While evaluating this for inclusion in 3.16.x, I ran into an apparent regression.
Consider a search that spans multiple pages in the results list. When I go to last hit in the first page, the next link is disabled. It should instead be active and clicking on it should permit traveling to the first hit on the second page of results.
Yep, sorry no to catch that before. I have just retested and recreated the issue. It seems that the me.searchCookie.total variable is always undefined, maybe a lead. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 --- Comment #15 from Juhani Seppälä <jseppal@student.uef.fi> --- Created attachment 29207 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=29207&action=edit Staff client next/previous links lead to unknown record When using Staff client next/previous links after a search : If the current record is the last of the results, clicking on "next" will lead to the page of an unknown record with message : The record you requested does not exist (NaN). To test: 1) Do an intranet catalog search that has more than 1 results. 2) Click on the last search result and then click the "Next"-button from the top-left navigation. 3) Confirm that you get thrown to a page with the message: "The record you requested does not exist (NaN).". 4) Apply patch. 5) Do an intranet search with more than 1 but less results than fit on a single page. 6) Click on the last result on the page and confirm that the "Next" navigation button is greyd out. 6) Do an intranet search with multi-page search results. 7) Click on the last result of a page that's not the final page of the results & confirm that "Next" is not grey out. 8) Navigate to the last page of the results and click on the final result & confirm that "Next" is greyd out. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 --- Comment #16 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Juhani Seppälä from comment #15)
Created attachment 29207 [details] [review]
Please reopen a new bug report and link it to this one.
When using Staff client next/previous links after a search : If the current record is the last of the results, clicking on "next" will lead to the page of an unknown record with message :
The record you requested does not exist (NaN).
This commit message is wrong, it is not the behavior on master since the patch from this bug report is pushed :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 --- Comment #17 from Juhani Seppälä <jseppal@student.uef.fi> --- (In reply to Jonathan Druart from comment #16)
(In reply to Juhani Seppälä from comment #15)
Created attachment 29207 [details] [review] [review]
Please reopen a new bug report and link it to this one.
When using Staff client next/previous links after a search : If the current record is the last of the results, clicking on "next" will lead to the page of an unknown record with message :
The record you requested does not exist (NaN).
This commit message is wrong, it is not the behavior on master since the patch from this bug report is pushed :)
Will open a new one for it - thanks for your patience. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Juhani Seppälä <jseppal@student.uef.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |12481 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12261 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |12481 Depends on|12481 | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org