[Bug 38678] New: GET /deleted/biblios cannot be filtered on `deleted_on`
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Bug ID: 38678 Summary: GET /deleted/biblios cannot be filtered on `deleted_on` Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org CC: tomascohen@gmail.com Because of a wrong mapping, filtering on the `deleted_on` attribute is not possible. To reproduce: 1. Perform this search: GET /api/v1/deleted/biblios { "-and": [ { "me.deleted_on": { ">=": "2024-10-01T08:35:24-05:00" } }, { "me.deleted_on": { "<=": "2024-11-19T08:35:25-07:00" } } ] } => FAIL: You get a 500. The logs say `me.deleted_on` doesn't exist. -- 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=38678 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |33960 Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33960 [Bug 33960] Add ability to retrieve deleted bibliographic records -- 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=38678 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 175376 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175376&action=edit Bug 38678: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 --- Comment #2 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 175377 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175377&action=edit Bug 38678: Fix wrong attribute mapping in Koha::Old::Biblio Because the mapping was defined in the wrong direction, it is not possible to filter results in `GET /deleted/biblios` neither on the `deleted_on` attribute, or even the fallback to DB fields when mappings don't exist, on `timestamp`. To test: 1. Apply the regression tests patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/deleted_biblios.t => FAIL: A 200 returns a 500 instead 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass, behavior is correct 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |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=38678 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |Failed QA --- Comment #3 from David Nind <david@davidnind.com> --- I had a go at testing, but am getting odd results: 1. With the regression patch applied, I get: prove t/db_dependent/api/v1/deleted_biblios.t t/db_dependent/api/v1/deleted_biblios.t .. 1/2 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Incorrect datetime value: '2024-12-12T17:33:57+00:00' for column `koha_kohadev`.`deletedbiblio`.`timestamp` at row 1 at /kohadevbox/koha/Koha/Object.pm line 172 # Looks like you planned 21 tests but ran 15. # Failed test 'list() tests' # at t/db_dependent/api/v1/deleted_biblios.t line 262. Invalid value passed, deletedbiblio.timestamp=2024-12-12T17:33:57+00:00 expected type is datetime# Looks like your test exited with 2 just after 2. t/db_dependent/api/v1/deleted_biblios.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 1/2 subtests Test Summary Report ------------------- t/db_dependent/api/v1/deleted_biblios.t (Wstat: 512 (exited 2) Tests: 2 Failed: 1) Failed test: 2 Non-zero exit status: 2 Files=1, Tests=2, 5 wallclock secs ( 0.01 usr 0.00 sys + 4.08 cusr 0.42 csys = 4.51 CPU) Result: FAIL 2. With both patches applied, I get: prove t/db_dependent/api/v1/deleted_biblios.t t/db_dependent/api/v1/deleted_biblios.t .. 1/2 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Incorrect datetime value: '2024-12-12T17:33:57+00:00' for column `koha_kohadev`.`deletedbiblio`.`timestamp` at row 1 at /kohadevbox/koha/Koha/Object.pm line 172 # Looks like you planned 21 tests but ran 15. t/db_dependent/api/v1/deleted_biblios.t .. 2/2 # Failed test 'list() tests' # at t/db_dependent/api/v1/deleted_biblios.t line 262. Invalid value passed, deletedbiblio.timestamp=2024-12-12T17:33:57+00:00 expected type is datetime# Looks like your test exited with 2 just after 2. t/db_dependent/api/v1/deleted_biblios.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 1/2 subtests Test Summary Report ------------------- t/db_dependent/api/v1/deleted_biblios.t (Wstat: 512 (exited 2) Tests: 2 Failed: 1) Failed test: 2 Non-zero exit status: 2 Files=1, Tests=2, 5 wallclock secs ( 0.01 usr 0.00 sys + 4.04 cusr 0.31 csys = 4.36 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to David Nind from comment #3)
prove t/db_dependent/api/v1/deleted_biblios.t t/db_dependent/api/v1/deleted_biblios.t .. 1/2 DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Incorrect datetime value: '2024-12-12T17:33:57+00:00' for column `koha_kohadev`.`deletedbiblio`.`timestamp` at row 1 at /kohadevbox/koha/Koha/Object.pm line 172
Interesting! It doesn't fail for me, but I'm using `DB_IMAGE=mysql:8.0`. Will compare with `mariadb:10.5` and provide a new patchset. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #175376|0 |1 is obsolete| | Attachment #175377|0 |1 is obsolete| | --- Comment #5 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 175669 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175669&action=edit Bug 38678: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 --- Comment #6 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 175670 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175670&action=edit Bug 38678: Fix wrong attribute mapping in Koha::Old::Biblio Because the mapping was defined in the wrong direction, it is not possible to filter results in `GET /deleted/biblios` neither on the `deleted_on` attribute, or even the fallback to DB fields when mappings don't exist, on `timestamp`. To test: 1. Apply the regression tests patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/deleted_biblios.t => FAIL: A 200 returns a 500 instead 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass, behavior is correct 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 David Nind <david@davidnind.com> 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=38678 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #175669|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 175671 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175671&action=edit Bug 38678: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #175670|0 |1 is obsolete| | --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 175672 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175672&action=edit Bug 38678: Fix wrong attribute mapping in Koha::Old::Biblio Because the mapping was defined in the wrong direction, it is not possible to filter results in `GET /deleted/biblios` neither on the `deleted_on` attribute, or even the fallback to DB fields when mappings don't exist, on `timestamp`. To test: 1. Apply the regression tests patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/deleted_biblios.t => FAIL: A 200 returns a 500 instead 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass, behavior is correct 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Tomás Cohen Arazi (tcohen) <tomascohen@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=38678 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.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=38678 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #175671|0 |1 is obsolete| | --- Comment #9 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 175988 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175988&action=edit Bug 38678: Regression tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@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=38678 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #175672|0 |1 is obsolete| | --- Comment #10 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Created attachment 175989 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=175989&action=edit Bug 38678: Fix wrong attribute mapping in Koha::Old::Biblio Because the mapping was defined in the wrong direction, it is not possible to filter results in `GET /deleted/biblios` neither on the `deleted_on` attribute, or even the fallback to DB fields when mappings don't exist, on `timestamp`. To test: 1. Apply the regression tests patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/deleted_biblios.t => FAIL: A 200 returns a 500 instead 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass, behavior is correct 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Matt Blenkinsop <matt.blenkinsop@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=38678 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matt.blenkinsop@ptfs-europe | |.com QA Contact|testopia@bugs.koha-communit |matt.blenkinsop@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.05.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=38678 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! 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=38678 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.05.00 | released in| | Keywords| |rel_24_11_candidate --- Comment #12 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Please consider for backport -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.11.02 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 --- Comment #13 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Nice work everyone! Pushed to 24.11.x for 24.11.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de Keywords|rel_24_11_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|24.11.02 |25.05.00 released in| |24.11.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|25.05.00 |25.05.00,24.11.02 released in|24.11.02 | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable CC| |alexbuckley@catalyst.net.nz Version(s)|25.05.00,24.11.02 |25.05.00,24.11.02,24.05.08 released in| | --- Comment #14 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Nice work everyone! Pushed to 24.05.x for 24.05.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Needs documenting CC| |fridolin.somers@biblibre.co | |m --- Comment #15 from Fridolin Somers <fridolin.somers@biblibre.com> --- Depends on Bug 33960 not in 23.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Lari Strand <lmstrand@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lmstrand@gmail.com --- Comment #16 from Lari Strand <lmstrand@gmail.com> --- Filtering on the timestamp is really slow. Should it be added to index? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38678 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED CC| |caroline.cyr-la-rose@inlibr | |o.com Resolution|--- |FIXED --- Comment #17 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Nothing to add/edit in the manual. If API documentation is needed, please specify and reopen. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org