[Bug 37902] New: Timezone ignored when passing rfc3339 formatted date (search 'q')
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Bug ID: 37902 Summary: Timezone ignored when passing rfc3339 formatted date (search 'q') Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@gmail.com QA Contact: testopia@bugs.koha-community.org CC: tomascohen@gmail.com 2. GET /api/v1/jobs?q={"enqueued_on":{">":"2024-09-04T09:26:52-03:00"}} is generating the following query SELECT `me`.`id`, `me`.`status`, `me`.`progress`, `me`.`size`, `me`.`borrowernumber`, `me`.`type`, `me`.`queue`, `me`.`data`, `me`.`context`, `me`.`enqueued_on`, `me`.`started_on`, `me`.`ended_on` FROM `background_jobs` `me` WHERE `enqueued_on` > '2024-09-04T09:26:52-03:00' But when you run it manually, you get a warning: | Warning | 1292 | Truncated incorrect datetime value: '2024-09-04T09:26:52-03:00' | -- 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=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |37831 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37831 [Bug 37831] [OMNIBUS] Timezone ignored when passing rfc3339 formatted date -- 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=37902 --- Comment #1 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171389 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171389&action=edit Bug 37902: Add tests -- 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=37902 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171390 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171390&action=edit Bug 37902: Make sure filtered_params are converted Previously we only adjusted the attributes that were passed directly, not the ones in 'q' (which is the recommended way now) -- 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=37902 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171391 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171391&action=edit Bug 37902: Make sure we loop over if a structure is passed -- 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=37902 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171392 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171392&action=edit Bug 37902: TODOs There are still different structures we won't handle properly. This patch adds conditionals to prevent failures or warnings. Should be done, but later. -- 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=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart@gmail.com |ity.org | Status|NEW |Needs Signoff -- 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=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37905 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37905 [Bug 37905] Correctly fix the "last hour" filter on the job list -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- Note that t/db_dependent/api/v1/checkouts.t is failing if the timezone in conf is not empty. It was failing before and still after after. The test is wrong (it does not mock the config). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- No, it does not work... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #7 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171402 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171402&action=edit Bug 37902: Adjust timezone We didn't take into account the server's timezone. This does not feel right, we are not supposed to deal with time zone outside of Koha::DateUtils. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #8 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #7)
Created attachment 171402 [details] [review] Bug 37902: Adjust timezone
We didn't take into account the server's timezone.
This does not feel right, we are not supposed to deal with time zone outside of Koha::DateUtils.
After retesting bug 37905 I noticed that the patch was wrong, and so something was missing here. However I don't understand why the tests were passing without! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171402|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171403 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171403&action=edit Bug 37902: Adjust timezone We didn't take into account the server's timezone. This does not feel right, we are not supposed to deal with time zone outside of Koha::DateUtils. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #10 from Jonathan Druart <jonathan.druart@gmail.com> --- There are failures t/db_dependent/api/v1/patrons.t .......... # Failed test '200 OK' # at t/db_dependent/api/v1/patrons.t line 173. # got: '500' # expected: '200' # Failed test 'Filtering by date works' # at t/db_dependent/api/v1/patrons.t line 173. # got: undef # expected: '179' # Failed test '200 OK' # at t/db_dependent/api/v1/patrons.t line 177. # got: '500' # expected: '200' # Failed test 'Filtering by date-time works' # at t/db_dependent/api/v1/patrons.t line 177. # got: undef # expected: '179' # Looks like you failed 4 tests of 12. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #11 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #10)
There are failures
t/db_dependent/api/v1/patrons.t .......... # Failed test '200 OK' # at t/db_dependent/api/v1/patrons.t line 173. # got: '500' # expected: '200'
This is a bad one. Invalid date format: %1980-06-18% at /kohadevbox/koha/Koha/REST/Plugin/Objects.pm line 288 Because we are now hitting Koha/REST/Plugin/Query.pm 195 my $match = $reserved_params->{_match} // 'contains'; 196 197 foreach my $param ( keys %{$filtered_params} ) { 198 if ( $match eq 'contains' ) { 199 $params->{$param} = 200 { like => '%' . $filtered_params->{$param} . '%' }; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #12 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171515 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171515&action=edit Bug 37902: Do not convert a date if it has like markers If we pass a datetime parameter we are adding "like" operator and % at the beginning and ending of the attribute value. For instance: attributes=2024-09-16 10:11:12 attributes:{ like => '%2024-09-16 10:11:12%' } We do not want to reach the fixup code and raise an exception. However I don't think we should add the like for datetime attributes actually. But can we modify this behaviour now? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |In Discussion Assignee|jonathan.druart@gmail.com |koha-bugs@lists.koha-commun | |ity.org --- Comment #13 from Jonathan Druart <jonathan.druart@gmail.com> --- There is still (at least) one failing test: # Failed test 'Filtering by date-time works' # at t/db_dependent/api/v1/patrons.t line 177. # got: undef # expected: '401' # Looks like you failed 1 test of 12. I don't think we are processing the values correctly. Why do we add like operator for dates? Do we want to keep this behaviour? I really need feedback and review on those patches before continuing working on this. -- 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=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171389|0 |1 is obsolete| | --- Comment #14 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171551 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171551&action=edit Bug 37902: Add tests -- 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=37902 --- Comment #15 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #14)
Created attachment 171551 [details] [review] Bug 37902: Add tests
This is fixing Martin's failure (401 unauthorized), I had this set in my custom.sql. Sorry! And kudos to Tomas who found this! -- 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=37902 --- Comment #16 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #13)
There is still (at least) one failing test:
# Failed test 'Filtering by date-time works' # at t/db_dependent/api/v1/patrons.t line 177. # got: undef # expected: '401' # Looks like you failed 1 test of 12.
I don't think we are processing the values correctly. Why do we add like operator for dates? Do we want to keep this behaviour?
I really need feedback and review on those patches before continuing working on this.
I think the like search for dates would only be used for partial date search in a column - i.e. "2024-07" - but we could probably replace that with year/month/day dropdowns - or just a datepicker and have reports for more complicated date searching? -- 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=37902 --- Comment #17 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Nick Clemens (kidclamp) from comment #16)
(In reply to Jonathan Druart from comment #13)
There is still (at least) one failing test:
# Failed test 'Filtering by date-time works' # at t/db_dependent/api/v1/patrons.t line 177. # got: undef # expected: '401' # Looks like you failed 1 test of 12.
I don't think we are processing the values correctly. Why do we add like operator for dates? Do we want to keep this behaviour?
I really need feedback and review on those patches before continuing working on this.
I think the like search for dates would only be used for partial date search in a column - i.e. "2024-07" - but we could probably replace that with year/month/day dropdowns - or just a datepicker and have reports for more complicated date searching?
Yes, but this could be done client-side. If we are passing an invalid/incomplete date then we can build the "like" part ourselves. -- 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=37902 --- Comment #18 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Nick Clemens (kidclamp) from comment #16)
(In reply to Jonathan Druart from comment #13)
There is still (at least) one failing test:
# Failed test 'Filtering by date-time works' # at t/db_dependent/api/v1/patrons.t line 177. # got: undef # expected: '401' # Looks like you failed 1 test of 12.
I don't think we are processing the values correctly. Why do we add like operator for dates? Do we want to keep this behaviour?
I really need feedback and review on those patches before continuing working on this.
I think the like search for dates would only be used for partial date search in a column - i.e. "2024-07" - but we could probably replace that with year/month/day dropdowns - or just a datepicker and have reports for more complicated date searching?
Flagging this comment as important, it's actually a TODO for some DT searches. -- 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=37902 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com --- Comment #19 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #17)
Yes, but this could be done client-side. If we are passing an invalid/incomplete date then we can build the "like" part ourselves.
Good point, we could skip autotruncation for date fields and have the user add them if needed -- 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=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37903 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37903 [Bug 37903] Timezone ignored when passing rfc3339 formatted date (POST,PUT,PATCH) -- 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=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |37952 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37952 [Bug 37952] Store datetime DB columns in UTC -- 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=37902 --- Comment #20 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 171652 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171652&action=edit Bug 37902: Apply exact match for datetime We do not want to apply "like" and do a "contains" search if a correctly formatted date is passed (ie. starting with "YYYY-MM-DD HH:MM:SS") It causes underlying problems if we add '%' characters to this string as it will then become an invalid date. There are several ways of dealing with this problem. This patch is suggesting the easiest path: Apply an exact search (ie. do not add '%') if the value appears to be a datetime. Certainly not the best looking patch but it seems to be quite effective: * no need to change the client * no need to rework build_query_params, merge_q_params, attributes_from_api We could (to confirm) pass the result set, but it seems a lot of additional processing (that is done later already, in attributes_from_api) -- 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=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- 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=37902 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- 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=37902 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171390|0 |1 is obsolete| | --- Comment #21 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 171762 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171762&action=edit Bug 37902: Make sure filtered_params are converted Previously we only adjusted the attributes that were passed directly, not the ones in 'q' (which is the recommended way now) Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- 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=37902 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171391|0 |1 is obsolete| | --- Comment #22 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 171763 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171763&action=edit Bug 37902: Make sure we loop over if a structure is passed Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- 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=37902 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171392|0 |1 is obsolete| | --- Comment #23 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 171764 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171764&action=edit Bug 37902: TODOs There are still different structures we won't handle properly. This patch adds conditionals to prevent failures or warnings. Should be done, but later. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- 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=37902 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171403|0 |1 is obsolete| | --- Comment #24 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 171765 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171765&action=edit Bug 37902: Adjust timezone We didn't take into account the server's timezone. This does not feel right, we are not supposed to deal with time zone outside of Koha::DateUtils. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- 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=37902 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171515|0 |1 is obsolete| | --- Comment #25 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 171766 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171766&action=edit Bug 37902: Do not convert a date if it has like markers If we pass a datetime parameter we are adding "like" operator and % at the beginning and ending of the attribute value. For instance: attributes=2024-09-16 10:11:12 attributes:{ like => '%2024-09-16 10:11:12%' } We do not want to reach the fixup code and raise an exception. However I don't think we should add the like for datetime attributes actually. But can we modify this behaviour now? Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- 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=37902 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171551|0 |1 is obsolete| | --- Comment #26 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 171767 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171767&action=edit Bug 37902: Add tests Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- 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=37902 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171652|0 |1 is obsolete| | --- Comment #27 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 171768 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171768&action=edit Bug 37902: Apply exact match for datetime We do not want to apply "like" and do a "contains" search if a correctly formatted date is passed (ie. starting with "YYYY-MM-DD HH:MM:SS") It causes underlying problems if we add '%' characters to this string as it will then become an invalid date. There are several ways of dealing with this problem. This patch is suggesting the easiest path: Apply an exact search (ie. do not add '%') if the value appears to be a datetime. Certainly not the best looking patch but it seems to be quite effective: * no need to change the client * no need to rework build_query_params, merge_q_params, attributes_from_api We could (to confirm) pass the result set, but it seems a lot of additional processing (that is done later already, in attributes_from_api) Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- 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=37902 --- Comment #28 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Makes sense, tests pass, there are tidiness complaints from QA tools -- 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=37902 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #29 from David Cook <dcook@prosentient.com.au> --- So bug 36217 stopped us from passing a UTC timestamp like 2024-09-26T18:41:24.268Z to the API. This timestamp was generated by Date().toISOString(). Bug 37905 wants to use a RFC3339 timestamp like 2024-09-26T14:45:36-04:00 via dayjs().format()... and bug 37902 (this one) allows us to use RFC3339... If we're going to convert the incoming timestamp from the client... do we want to use RFC3339 or why not keep using ISO? Anyway, I'll look at this more later. Doing things in person with humans today and now the day is over... -- 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=37902 --- Comment #30 from Jonathan Druart <jonathan.druart@gmail.com> --- David, if you are asking what's the next step then have a look at bug 37952. -- 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=37902 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Assignee|koha-bugs@lists.koha-commun |jonathan.druart@gmail.com |ity.org | -- 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=37902 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Kyle M Hall (khall) <kyle@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=37902 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171762|0 |1 is obsolete| | Attachment #171763|0 |1 is obsolete| | Attachment #171764|0 |1 is obsolete| | Attachment #171765|0 |1 is obsolete| | Attachment #171766|0 |1 is obsolete| | Attachment #171767|0 |1 is obsolete| | Attachment #171768|0 |1 is obsolete| | --- Comment #31 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 172105 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172105&action=edit Bug 37902: Make sure filtered_params are converted Previously we only adjusted the attributes that were passed directly, not the ones in 'q' (which is the recommended way now) Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #32 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 172106 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172106&action=edit Bug 37902: Make sure we loop over if a structure is passed Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #33 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 172107 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172107&action=edit Bug 37902: TODOs There are still different structures we won't handle properly. This patch adds conditionals to prevent failures or warnings. Should be done, but later. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #34 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 172108 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172108&action=edit Bug 37902: Adjust timezone We didn't take into account the server's timezone. This does not feel right, we are not supposed to deal with time zone outside of Koha::DateUtils. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #35 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 172109 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172109&action=edit Bug 37902: Do not convert a date if it has like markers If we pass a datetime parameter we are adding "like" operator and % at the beginning and ending of the attribute value. For instance: attributes=2024-09-16 10:11:12 attributes:{ like => '%2024-09-16 10:11:12%' } We do not want to reach the fixup code and raise an exception. However I don't think we should add the like for datetime attributes actually. But can we modify this behaviour now? Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #36 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 172110 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172110&action=edit Bug 37902: Add tests Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #37 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 172111 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172111&action=edit Bug 37902: Apply exact match for datetime We do not want to apply "like" and do a "contains" search if a correctly formatted date is passed (ie. starting with "YYYY-MM-DD HH:MM:SS") It causes underlying problems if we add '%' characters to this string as it will then become an invalid date. There are several ways of dealing with this problem. This patch is suggesting the easiest path: Apply an exact search (ie. do not add '%') if the value appears to be a datetime. Certainly not the best looking patch but it seems to be quite effective: * no need to change the client * no need to rework build_query_params, merge_q_params, attributes_from_api We could (to confirm) pass the result set, but it seems a lot of additional processing (that is done later already, in attributes_from_api) Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #38 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 172112 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=172112&action=edit Bug 37902: (QA follow-up) Tidy Query.pm & Object.t Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #39 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #30)
David, if you are asking what's the next step then have a look at bug 37952.
No, that's not what I meant, but you can ignore my earlier question, as I've done more digging and I think I understand better today than yesterday. If I understand correctly, Koha::DateTime::Format::RFC3339->parse_datetime() should correctly parse both 2024-09-26T18:41:24.268Z and 2024-09-26T14:45:36-04:00 and set the time_zone appropriately. I looked back through your patches and Koha::Object->attributes_from_api() pre-patch, so I better understand what bug you're trying to fix here. I haven't thoroughly reviewed and understood every line of code, but I get the general idea. -- I was wondering if there would be any negative unintended consequences of fixing this bug... but we should be OK anywhere that dayjs() with the RFC3339 output or Date().toISOString() is used. If no timezone is provided, it's just assumed that the server timezone is used, right? -- The % for the -like operator is still going to be a problem, but... I think that's a future problem, which will be part of bug 37952 anyway, as you say Jonathan, so I'll comment more there... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #40 from David Cook <dcook@prosentient.com.au> --- If it's tl;dr, ignore the above comment and just know that I think it's all good here :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 --- Comment #41 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed --- Comment #42 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I believe the fail on Main/D10 and Main/U20 relates to this bug: 16:07:00 koha_1 | # Failed test 'No tests run for subtest "date handling"' 16:07:00 koha_1 | # at t/db_dependent/Koha/REST/Plugin/Objects.t line 1041. 16:07:00 koha_1 | Can't locate object method "rfc3339" via package "DateTime" at t/db_dependent/Koha/REST/Plugin/Objects.t line 1024. 16:07:00 koha_1 | # Looks like your test exited with 255 just after 18. 16:07:00 koha_1 | [16:05:10] t/db_dependent/Koha/REST/Plugin/Objects.t ................................... 16:07:00 koha_1 | Dubious, test returned 255 (wstat 65280, 0xff00) 16:07:00 koha_1 | Failed 1/18 subtests Maybe a problem with some of the dependencies in the older OS versions? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |38216 Keywords|additional_work_needed | --- Comment #43 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Katrin Fischer from comment #42)
I believe the fail on Main/D10 and Main/U20 relates to this bug:
16:07:00 koha_1 | # Failed test 'No tests run for subtest "date handling"' 16:07:00 koha_1 | # at t/db_dependent/Koha/REST/Plugin/Objects.t line 1041. 16:07:00 koha_1 | Can't locate object method "rfc3339" via package "DateTime" at t/db_dependent/Koha/REST/Plugin/Objects.t line 1024. 16:07:00 koha_1 | # Looks like your test exited with 255 just after 18. 16:07:00 koha_1 | [16:05:10] t/db_dependent/Koha/REST/Plugin/Objects.t ................................... 16:07:00 koha_1 | Dubious, test returned 255 (wstat 65280, 0xff00) 16:07:00 koha_1 | Failed 1/18 subtests
Maybe a problem with some of the dependencies in the older OS versions?
Moved to bug 38216. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38216 [Bug 38216] Objects.t failing on D10 and U20 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |RFC3339 formatted dates are release notes| |not correctly taken into | |account when passed to an | |attribute via the 'q' | |parameter Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37902 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to main |RESOLVED Resolution|--- |FIXED --- Comment #44 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Enhancement won't be backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org