Follow-up report for Bug 25553 - Edit item date sort does not sort correctly
Created attachment 108437 [details] [review] Bug 26233: (bug 25553 follow-up) Make date columns sortable on the edit items table We were missing to pass the title-string to datatables. Test plan: Retest bug 26233, with appropriate dates
Jonathan, I applied this patch and the itemst still doesn't sort dates correctly for me on additem.tt
Created attachment 108522 [details] [review] Add data-order attr to <td> that include dates This patch adds the special dataTable attr 'data-order' in order to correctly sort the dates To test: Retest Bug 23233, with appropriate dates
This data-order patch works with or without Jonathan's patch so I left his alone.
I will retest but I am pretty sure it works when I tested it this morning. I don't think we should use data-order, but stick to the way we usually order dates (title-string) instead.
Jonathan, I am testing items with these dates and the sorting of dateaccessioned still seems wrong: MariaDB [koha_kohadev]> select itemnumber, dateaccessioned from items where biblionumber = '4'; +------------+-----------------+ | itemnumber | dateaccessioned | +------------+-----------------+ | 12 | 2015-01-28 | | 13 | 2015-04-08 | | 14 | 2014-05-08 | | 18 | 2015-11-28 | +------------+-----------------+ Thanks!
I think we've already used data-order in at least one spot.
data-order wasn't available in DataTables when we first started using the plugin. I think it is preferable to use data-order going forward because it's not dependent on our own addon.
(In reply to Lucas Gass from comment #6) > Jonathan, > > I am testing items with these dates and the sorting of dateaccessioned still > seems wrong: > > MariaDB [koha_kohadev]> select itemnumber, dateaccessioned from items where > biblionumber = '4'; > +------------+-----------------+ > | itemnumber | dateaccessioned | > +------------+-----------------+ > | 12 | 2015-01-28 | > | 13 | 2015-04-08 | > | 14 | 2014-05-08 | > | 18 | 2015-11-28 | > +------------+-----------------+ Looks ok for me: https://snipboard.io/2MTgn6.jpg
(In reply to Owen Leonard from comment #8) > data-order wasn't available in DataTables when we first started using the > plugin. I think it is preferable to use data-order going forward because > it's not dependent on our own addon. The "span title" needs to be removed in that case :) If we go with data-order I think we should do a big move and have only 1 way of doing things. I am willing to help anybody who would like to work on that.
I don't install this patch, but I have already patch for bug 25553 and it works +------------+-----------------+ | itemnumber | dateaccessioned | +------------+-----------------+ | 42365 | 2013-12-30 | | 42366 | 2015-06-11 | | 84707 | 2019-03-14 | +------------+-----------------+ https://prnt.sc/u2b7od
Hi Ivan, please try with the 4 dates from comment 6 and with the system preferences dateformat set to "us"
(In reply to Jonathan Druart from comment #12) > Hi Ivan, please try with the 4 dates from comment 6 and with the system > preferences dateformat set to "us" Hi Jonathan, sorry I don't have biblionumber = '4', but I have more than 4 dates for biblionumber = '66343' and it works nice... T-SQL: select itemnumber, dateaccessioned from items where biblionumber = '66343'; +------------+-----------------+ | itemnumber | dateaccessioned | +------------+-----------------+ | 75554 | 2014-11-25 | | 75555 | 2014-12-17 | | 75556 | 2014-12-17 | | 75557 | 2015-01-28 | | 75558 | 2015-02-21 | | 75559 | 2015-03-17 | | 75560 | 2015-04-14 | | 75561 | 2015-05-21 | | 75562 | 2015-06-11 | | 75563 | 2015-08-28 | | 75564 | 2015-10-13 | | 75565 | 2015-11-19 | | 75566 | 2016-01-06 | | 75567 | 2016-02-11 | | 75568 | 2016-03-15 | | 75569 | 2016-04-13 | | 75570 | 2016-05-07 | | 75571 | 2016-06-15 | | 75572 | 2016-08-19 | | 75573 | 2016-09-21 | | 75574 | 2016-11-23 | +------------+-----------------+ https://prnt.sc/u2dabp Thanks!
Jonathan, Because you pushed 26234 to master this patch no longer cleanly applies.
You can easily run a report and get the same results. I have hundred of holdings and can show that it doesn't work properly. Let's take Der Spiegel for example. I have 630 holdings in my test server running 19.11.08. https://vtlib-eds-files.s3.amazonaws.com/Screen+Shot+2020-08-19+at+5.13.10+PM.png
(In reply to Lucas Gass from comment #14) > Jonathan, > > Because you pushed 26234 to master this patch no longer cleanly applies. Ho right, I understand now! So this patch is no longer needed in master, that's certainly why it was working for Ivan!
Yes, this issue is now fixed (in my testing) because of Bug 26234, marking this one resolved. Thanks everyone!
> The "span title" needs to be removed in that case :) > If we go with data-order I think we should do a big move and have only 1 way > of doing things. I am willing to help anybody who would like to work on that. If we would like to go the data-order route moving forward I would be happy to work on that.
It needs to be backported Lucas.
I've applied this patch to 20.05.x and these dates still do not sort correctly for me. I used the same sample data that I mentioned in Comment 6. I go to /cgi-bin/koha/cataloguing/additem.pl And my sorting looks like this: https://snipboard.io/MX5B2c.jpg https://snipboard.io/0AHUva.jpg
Lucas, it looks of for me: 07a4da6ae5 (HEAD) Bug 26233: (bug 25553 follow-up) Make date columns sortable on the edit items table fdc76815ba (origin/20.05.x) Bug 25348: (QA follow-up) Silence irrelevant warnings % restart_all /cgi-bin/koha/cataloguing/additem.pl?biblionumber=4 Edit the 4 items. Before sorting: https://snipboard.io/9a1Q64.jpg After: https://snipboard.io/UzcnIG.jpg I confirm it's broken *without* this patch.
Without the patch, my items do not sort correctly by dateacquired or datelastseen on 20.05.x: https://snipboard.io/ONZvwk.jpg With the patch, they do sort correctly: https://snipboard.io/OJ4dpu.jpg
Created attachment 109224 [details] [review] Bug 26233: (bug 25553 follow-up) Make date columns sortable on the edit items table We were missing to pass the title-string to datatables. Test plan: Retest bug 26233, with appropriate dates Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 109278 [details] [review] Bug 26233: (bug 25553 follow-up) Make date columns sortable on the edit items table We were missing to pass the title-string to datatables. Test plan: Retest bug 26233, with appropriate dates Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Nick, can you please finish here once you got the feedback from Lucas?
Sending to 20.05 queue.
pushed to 20.05.x for 20.05.04
backported to 19.11.x for 19.11.10
Backported to 19.05.x branch for 19.05.15