[Bug 28764] New: Sorting not correct in pagination on OPAC lists
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 Bug ID: 28764 Summary: Sorting not correct in pagination on OPAC lists Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org When viewing a list on the OPAC you can force a sorting direction by appending to the sortfield with a colon: sortfield=dateadded:desc When clicking on the next page, however, the direction is formed as: direction=desc&sortfield=dateadded The script doesn't read the 'direction' parameter, so sorting fails To recreate: 1 - Create a public list 2 - Add enough items to generate two pages (40 worked for me) 3 - View the list and enforce sorting by date added descending: sortfield=dateadded:desc 4 - Note the titles shown 5 - Click to second page using the pagination bar 6 - Note the same titles are shown, in a reversed order -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=28764 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 123205 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123205&action=edit Bug 28764: Parse direction parameter in public list view This patch adds a check for a 'direction' paramter in list sorting. It maintains the existing syntax for sorting 'sortfield=field:direction' but adds support for the form used in paginations and more commonly thtoughout Koha' sortfield=field&direction=direction' To test: 1 - Create a public list 2 - Add enough items to generate two pages (40 worked for me) 3 - View the list and enforce sorting by date added descending: sortfield=dateadded:desc 4 - Note the titles shown 5 - Click to second page using the pagination bar 6 - Note the same titles are shown, in a reversed order 7 - Apply patch 8 - repeat 305 9 - Second page is sorted correctly! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch 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=28764 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #123205|0 |1 is obsolete| | --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 123207 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123207&action=edit Bug 28764: Parse direction parameter in public list view This patch adds a check for a 'direction' paramter in list sorting. It maintains the existing syntax for sorting 'sortfield=field:direction' but adds support for the form used in paginations and more commonly thtoughout Koha' sortfield=field&direction=direction' To test: 1 - Create a public list 2 - Add enough items to generate two pages (40 worked for me) 3 - View the list and enforce sorting by date added descending: sortfield=dateadded:desc 4 - Note the titles shown 5 - Click to second page using the pagination bar 6 - Note the same titles are shown, in a reversed order 7 - Apply patch 8 - repeat 305 9 - Second page is sorted correctly! Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- This is a bit confusing. We overrule the sortfield parameter which is still used in Koha by direction. When I am in Your Lists, I click Sort and get a URL with sortfield=title:desc If direction is the way to go, please be more thorough. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 123297 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123297&action=edit Bug 28764: Alter sort dropdown to use direction parameter This code is odd -we build a select in the template, then turn it into a list of links using javascript This patch adds a direction data element and uses it while building the links -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Marcel de Rooy from comment #3)
This is a bit confusing. We overrule the sortfield parameter which is still used in Koha by direction.
When I am in Your Lists, I click Sort and get a URL with sortfield=title:desc
If direction is the way to go, please be more thorough.
I think the follow up is something like you wanted? We could remove the old style all together, but I felt libraries could have existing links that we should not break. Rewriting the code here to build the dropdown sorting list more straightforward is beyond scope I think. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Trivial patch |Small patch 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=28764 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #123207|0 |1 is obsolete| | --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 123650 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123650&action=edit Bug 28764: Parse direction parameter in public list view This patch adds a check for a 'direction' paramter in list sorting. It maintains the existing syntax for sorting 'sortfield=field:direction' but adds support for the form used in paginations and more commonly thtoughout Koha' sortfield=field&direction=direction' To test: 1 - Create a public list 2 - Add enough items to generate two pages (40 worked for me) 3 - View the list and enforce sorting by date added descending: sortfield=dateadded:desc 4 - Note the titles shown 5 - Click to second page using the pagination bar 6 - Note the same titles are shown, in a reversed order 7 - Apply patch 8 - repeat 305 9 - Second page is sorted correctly! Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #123297|0 |1 is obsolete| | --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 123651 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123651&action=edit Bug 28764: Alter sort dropdown to use direction parameter This code is odd -we build a select in the template, then turn it into a list of links using javascript This patch adds a direction data element and uses it while building the links Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 123652 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123652&action=edit Bug 28764: (QA follow-up) Add comment, remove two defined's If we no longer offer the sortfield with :asc actively, we should probably write it somewhere too. Replaced a few defined tests by empty test. No need to split empty string or zero etc. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, 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=28764 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.11.00 |21.11.00,21.05.03 released in| | Status|Pushed to master |Pushed to stable CC| |kyle@bywatersolutions.com --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.05.x for 21.05.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable CC| |fridolin.somers@biblibre.co | |m Version(s)|21.11.00,21.05.03 |21.11.00,21.05.03,20.11.09 released in| | --- Comment #11 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28764 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED --- Comment #12 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org