Bug 20455 - Can't sort patron search on date expired
Summary: Can't sort patron search on date expired
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
: 20331 (view as bug list)
Depends on: 20145
Blocks:
  Show dependency treegraph
 
Reported: 2018-03-20 21:31 UTC by Katrin Fischer
Modified: 2019-10-14 19:57 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 20455: Fix sort patrons by date expired (1.51 KB, patch)
2018-03-26 16:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 20455: Fix sort patrons by date expired (1.55 KB, patch)
2018-03-26 22:41 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 20455: Fix sort patrons by date expired (1.61 KB, patch)
2018-03-27 21:22 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2018-03-20 21:31:54 UTC
The patron search hangs when you try to sort by date expired.

The error in the Plack logs is:

Odd number of elements in anonymous hash at /home/vagrant/kohaclone/C4/Utils/DataTables/Members.pm line 189.
output_pref is called with 'dateonly' (ref SCALAR), not a DateTime objectOdd number of elements in anonymous hash at /home/vagrant/kohaclone/C4/Utils/DataTables/Members.pm line 189.

To test:
- Make sure sample patron data is loaded
- Make an empty search for all patrons or another search that gives you a good amount of results
- Try to sort on the date expired column
Comment 1 Jonathan Druart 2018-03-26 16:16:18 UTC
Created attachment 73287 [details] [review]
Bug 20455: Fix sort patrons by date expired

We may need to apply this change for all other occurrences in our
codebase.

Test plan:
- Make sure sample patron data is loaded and you have a patron without a
date expired defined
- Make an empty search for all patrons or another search that gives you
a good amount of results
- Try to sort on the date expired column

=> Without this patch you get
Odd number of elements in anonymous hash
at /home/vagrant/kohaclone/C4/Utils/DataTables/Members.pm line 189.
output_pref is called with 'dateonly' (ref SCALAR), not a DateTime
object
Comment 2 Mark Tompsett 2018-03-26 22:38:59 UTC
kohadevbox reset_all
in mysql client
update borrowers set dateexpiry=null where borrowernumber=1
in staff client
click patrons in top menu bar
in left pane, search for 'a' as 'Surname'.
list comes up.
sort on 'Expires on', results in processing hang and errors as described in comment #0.
Comment 3 Mark Tompsett 2018-03-26 22:41:50 UTC
Created attachment 73296 [details] [review]
Bug 20455: Fix sort patrons by date expired

We may need to apply this change for all other occurrences in our
codebase.

Test plan:
- Make sure sample patron data is loaded and you have a patron without a
date expired defined
- Make an empty search for all patrons or another search that gives you
a good amount of results
- Try to sort on the date expired column

=> Without this patch you get
Odd number of elements in anonymous hash
at /home/vagrant/kohaclone/C4/Utils/DataTables/Members.pm line 189.
output_pref is called with 'dateonly' (ref SCALAR), not a DateTime
object

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 4 Katrin Fischer 2018-03-27 21:22:40 UTC
Created attachment 73358 [details] [review]
Bug 20455: Fix sort patrons by date expired

We may need to apply this change for all other occurrences in our
codebase.

Test plan:
- Make sure sample patron data is loaded and you have a patron without a
date expired defined
- Make an empty search for all patrons or another search that gives you
a good amount of results
- Try to sort on the date expired column

=> Without this patch you get
Odd number of elements in anonymous hash
at /home/vagrant/kohaclone/C4/Utils/DataTables/Members.pm line 189.
output_pref is called with 'dateonly' (ref SCALAR), not a DateTime
object

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2018-03-28 18:23:05 UTC
*** Bug 20331 has been marked as a duplicate of this bug. ***
Comment 6 Jonathan Druart 2018-03-29 15:03:23 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 7 Nick Clemens 2018-05-14 21:25:31 UTC
Pushed to stable for 17.11.06

Awesome work all!
Comment 8 Fridolin Somers 2018-05-22 09:23:35 UTC
Pushed to 17.05.x for v17.05.12