Bug 20455

Summary: Can't sort patron search on date expired
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, gmcharlt, jonathan.druart, josef.moravec, kyle.m.hall, mtompset, niamh.walker-headon, nick
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Who signed the patch off: Text to go in the release notes:
Version(s) released in:
Bug Depends on: 20145    
Bug Blocks:    
Attachments: Bug 20455: Fix sort patrons by date expired
Bug 20455: Fix sort patrons by date expired
Bug 20455: Fix sort patrons by date expired

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 M. 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 M. 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