[Bug 19564] New: Fix extraction of sort order from sort condition name
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 Bug ID: 19564 Summary: Fix extraction of sort order from sort condition name Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Searching - Elasticsearch Assignee: koha-bugs@lists.koha-community.org Reporter: glasklas@gmail.com Currently sort order is extracted from sort condition with "my ( $f, $d ) = split /_/;" So for example with the value "call_number_asc", you get $f (field) "call", and $d (order) "number", when expecting to get "call_number" and "asc". This should be changes using a regular expression instead. -- 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=19564 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |glasklas@gmail.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=19564 --- Comment #1 from David Gustafsson <glasklas@gmail.com> --- Created attachment 68892 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68892&action=edit Bug 19564: Fix extraction of sort order from sort condition name Currently sort order is extracted from sort condition by splitting the field, instead use regular expression to extract the last part preceded by underscore. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 --- Comment #2 from David Gustafsson <glasklas@gmail.com> --- I did not add a test-case since sorting does currently work anyway because of other unrelated bugs (which I can link to once having created issues and submitted fixes f). But this Perl code can be executed to illustrate the issue (and fix): my ( $f, $d ) = "call_number_asc" =~ /(.+)_(.+)/; print "$f $d\n"; ( $f, $d ) = split /_/, "call_number_asc"; print "$f $d\n"; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 --- Comment #3 from David Gustafsson <glasklas@gmail.com> --- Replaced the wrong line in previous patch, will fix. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68892|0 |1 is obsolete| | --- Comment #4 from David Gustafsson <glasklas@gmail.com> --- Created attachment 68998 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68998&action=edit Bug 19564: Fix extraction of sort order from sort condition name Currently sort order is extracted from sort condition by splitting the field, instead use regular expression to extract the last part preceded by underscore. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- This works, I mean we need a callnum index, but it changes form not having a sort to having a sort on an undefined index :-) let me know what other bugs you are working on -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 --- Comment #6 from David Gustafsson <glasklas@gmail.com> --- Yes, although I think it's a good idea to fix the code even though it does not solve the issue with the current code base, I think that sorting should work with this fix together with https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19563 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 --- Comment #7 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Nick Clemens from comment #5)
This works, I mean we need a callnum index, but it changes form not having a sort to having a sort on an undefined index :-) let me know what other bugs you are working on
I think I didn't finish my thought here, we need unit tests here to verify the change, if you can provide those I will sign off. If you need any help with them let me know. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 70137 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70137&action=edit Bug 19564: Add tests for _convert_sort_fields -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Nice ascii art -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=19564 --- Comment #10 from David Gustafsson <glasklas@gmail.com> --- :) Thanks for the tests! Will apply and test this tomorrow. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #11 from David Gustafsson <glasklas@gmail.com> --- I had time to do so today. Don't know if I am allowed to sign this off, but can vouch for that the tests are working. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 David Gustafsson <glasklas@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 Nicolas Legrand <nicolas.legrand@bulac.fr> 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=19564 Nicolas Legrand <nicolas.legrand@bulac.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68998|0 |1 is obsolete| | --- Comment #12 from Nicolas Legrand <nicolas.legrand@bulac.fr> --- Created attachment 73022 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=73022&action=edit Bug 19564: Fix extraction of sort order from sort condition name Currently sort order is extracted from sort condition by splitting the field, instead use regular expression to extract the last part preceded by underscore. Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 Nicolas Legrand <nicolas.legrand@bulac.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #70137|0 |1 is obsolete| | --- Comment #13 from Nicolas Legrand <nicolas.legrand@bulac.fr> --- Created attachment 73023 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=73023&action=edit Bug 19564: Add tests for _convert_sort_fields Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 Nick Clemens <nick@bywatersolutions.com> 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=19564 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #73022|0 |1 is obsolete| | Attachment #73023|0 |1 is obsolete| | --- Comment #14 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 73385 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=73385&action=edit Bug 19564: Fix extraction of sort order from sort condition name Currently sort order is extracted from sort condition by splitting the field, instead use regular expression to extract the last part preceded by underscore. Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Nick Clemens <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=19564 --- Comment #15 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 73386 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=73386&action=edit Bug 19564: Add tests for _convert_sort_fields Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Nick Clemens <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=19564 --- Comment #16 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 73387 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=73387&action=edit Bug 19564: (QA follow-up) Make commented out tests pass We likely shoudln't pass through an uncoverted sort order for now, but it does allow us to look ahead to implementing the orders directly so seems a good option to have. Either this patch should be used, or the commented out tests should be removed Signed-off-by: Nick Clemens <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=19564 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 18.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=19564 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #18 from Nick Clemens <nick@bywatersolutions.com> --- Pushed to stable for 17.11.06 Awesome work all! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19564 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |fridolin.somers@biblibre.co | |m Status|Pushed to Stable |RESOLVED --- Comment #19 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Not pushed to 17.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org