[Bug 28248] New: Exception when getting all orders
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 Bug ID: 28248 Summary: Exception when getting all orders Change sponsored?: --- Product: Koha Version: 20.05 Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: somesecretemail@mailinator.com Making a get request against /api/v1/acquisitions/orders/ generates the following exception when aqorders.created_by is null i database [2021-04-28 14:10:21.48828] [600131] [warn] OpenAPI >>> GET api/v1/acquisitions/orders/ [{"message":"Expected integer - got null.","path":"\/0\/created_by"},{"message":"Expected integer - got null.","path":"\/1\/created_by"},{"message":"Expected integer - got null.","path":"\/2\/created_by"},{"message":"Expected integer - got null.","path":"\/3\/created_by"},{"message":"Expected integer - got null.","path":"\/4\/created_by"},{"message":"Expected integer - got null." -- 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=28248 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|20.05 |master CC| |jonathan.druart+koha@gmail. | |com Depends on| |18731 --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Can be NULL in DB 638 `created_by` int(11) DEFAULT NULL COMMENT 'the borrowernumber of order line''s creator', But not in the API specs. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18731 [Bug 18731] Add routes for acquisition orders -- 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=28248 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | CC| |tomascohen@gmail.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=28248 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|master |20.05 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- What version of Koha are you using, Stefan? This is fixed in 20.11+. I will submit a patch for 20.05. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- They are using 20.05.09 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Version|20.05 |20.11 --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This is fixed in master/21.05+ by bug 20212, so making it a target for 20.11 as well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 120318 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120318&action=edit Bug 28248: aqorders.created_by is nullable This patch introduces a change to the spec to acknowledge that the field is nullable. This is fixed in 21.05+ as part of bug 20212. To test: 1. Have an order with created_by = NULL 2. Use your favourite REST tool (Postman?) to fetch the order => FAIL: It throws a nasty error about non-nullable field being null 3. Apply this patch 4. Reload all 5. Repeat 2 => SUCCESS: It returns things, created_by is NULL, as it should 6. 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=28248 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=20212 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Stefan, can you test this patch and confirm that it fixes the issue you reported? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120318|0 |1 is obsolete| | --- Comment #7 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 120349 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120349&action=edit Bug 28248: aqorders.created_by is nullable This patch introduces a change to the spec to acknowledge that the field is nullable. This is fixed in 21.05+ as part of bug 20212. To test: 1. Have an order with created_by = NULL 2. Use your favourite REST tool (Advanced REST Client(libre), Postman?) to fetch the order => FAIL: It throws a nasty error about non-nullable field being null 3. Apply this patch 4. Reload all 5. Repeat 2 => SUCCESS: It returns things, created_by is NULL, as it should 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |victor@tuxayo.net --- Comment #8 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Works :) Testing notes: - don't forget it's for 20.11.x, not master. - Testing without REST client can be done via http://localhost:8081/api/v1/acquisitions/orders/1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 --- Comment #9 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Code looks good, QA script happy. Count my QA stamp in :) Signoff still needed if you can Stefan. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch CC| |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=28248 --- Comment #10 from Kyle M Hall <kyle@bywatersolutions.com> --- It's been over a week. I think it's safe to move forward on this one! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |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=28248 Kyle M Hall <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=28248 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120349|0 |1 is obsolete| | --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 120675 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120675&action=edit Bug 28248: aqorders.created_by is nullable This patch introduces a change to the spec to acknowledge that the field is nullable. This is fixed in 21.05+ as part of bug 20212. To test: 1. Have an order with created_by = NULL 2. Use your favourite REST tool (Advanced REST Client(libre), Postman?) to fetch the order => FAIL: It throws a nasty error about non-nullable field being null 3. Apply this patch 4. Reload all 5. Repeat 2 => SUCCESS: It returns things, created_by is NULL, as it should 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> 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=28248 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master --- Comment #12 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Sending to 20.11 queue. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.06 released in| | CC| |fridolin.somers@biblibre.co | |m Status|Pushed to master |Pushed to stable --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|20.11.06 |20.11.06,20.05.12 released in| | CC| |andrew@bywatersolutions.com --- Comment #14 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 20.05.x for 20.05.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28248 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED --- Comment #15 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Missing dependencies for 19.11.x, it shouldn't be affected, no backport. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org