[Bug 26271] New: Call to /api/v1/patrons/<patron_id>/account returns 500 error if manager_id is NULL
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26271 Bug ID: 26271 Summary: Call to /api/v1/patrons/<patron_id>/account returns 500 error if manager_id is NULL Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: joonas.kylmala@helsinki.fi Making a call to /api/v1/patrons/<patron_id>/account where the patron has an accountline with manager_id = NULL causes the request to fail with error code 500 because the swagger spec defines only integer as user_id/manager_id type. It should also accept null types because fines.pl cron seems to create accountlines with manager_id=NULL. -- 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=26271 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=26271 --- Comment #1 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- Created attachment 108820 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=108820&action=edit Bug 26271: Add failing test to reveal issue with patrons API endpoint When manager_id is null/undef the API returns error code 500. To test: 1) Notice failure when running prove t/db_dependent/api/v1/patrons_accounts.t -- 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=26271 --- Comment #2 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- Created attachment 108821 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=108821&action=edit Bug 26271: Add null to the list of accepted account_line data types The database schema for accountlines table allows the manager_id/user_id column to be NULL. If request to /api/v1/patrons/<patron_id>/account returns such an accountline where it is NULL we get 500 error as response. Adding NULL to allowed data types fixes this issue. To test: 1) Run prove t/db_dependent/api/v1/patrons_accounts.t and notice it doesn't fail -- 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=26271 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- 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=26271 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #108821|0 |1 is obsolete| | --- Comment #3 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 109583 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109583&action=edit Bug 26271: Add null to the list of accepted account_line data types The database schema for accountlines table allows the manager_id/user_id column to be NULL. If request to /api/v1/patrons/<patron_id>/account returns such an accountline where it is NULL we get 500 error as response. Adding NULL to allowed data types fixes this issue. To test: 1) Run prove t/db_dependent/api/v1/patrons_accounts.t and notice it doesn't fail Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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=26271 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #108820|0 |1 is obsolete| | --- Comment #4 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 109584 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109584&action=edit Bug 26271: Add failing test to reveal issue with patrons API endpoint When manager_id is null/undef the API returns error code 500. To test: 1) Notice failure when running prove t/db_dependent/api/v1/patrons_accounts.t Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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=26271 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109583|0 |1 is obsolete| | --- Comment #5 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Created attachment 109585 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109585&action=edit Bug 26271: Add null to the list of accepted account_line data types The database schema for accountlines table allows the manager_id/user_id column to be NULL. If request to /api/v1/patrons/<patron_id>/account returns such an accountline where it is NULL we get 500 error as response. Adding NULL to allowed data types fixes this issue. To test: 1) Run prove t/db_dependent/api/v1/patrons_accounts.t and notice it doesn't fail Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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=26271 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #6 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Looks perfect ;) -- 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=26271 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109584|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 109591 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109591&action=edit Bug 26271: Add failing test to reveal issue with patrons API endpoint When manager_id is null/undef the API returns error code 500. To test: 1) Notice failure when running prove t/db_dependent/api/v1/patrons_accounts.t Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.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=26271 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #109585|0 |1 is obsolete| | --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 109592 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109592&action=edit Bug 26271: Add null to the list of accepted account_line data types The database schema for accountlines table allows the manager_id/user_id column to be NULL. If request to /api/v1/patrons/<patron_id>/account returns such an accountline where it is NULL we get 500 error as response. Adding NULL to allowed data types fixes this issue. To test: 1) Run prove t/db_dependent/api/v1/patrons_accounts.t and notice it doesn't fail Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.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=26271 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Passed QA --- Comment #9 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Works as expected, well spotted. Passing QA -- 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=26271 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact| |martin.renvoize@ptfs-europe | |.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=26271 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26332 -- 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=26271 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |joonas.kylmala@helsinki.fi |ity.org | CC| |jonathan.druart@bugs.koha-c | |ommunity.org -- 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=26271 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- That is something I was expected for a while. We are going to face this problem again and again. We need a test to compare the API definition and the DB schema (datatype and nullable). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26271 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26271 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26271 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Version(s)|20.11.00 |20.11.00, 20.05.04 released in| | --- Comment #12 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 20.05.x for 20.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26271 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |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=26271 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aleisha@catalyst.net.nz Status|Pushed to stable |Pushed to oldstable Version(s)|20.11.00, 20.05.04 |20.11.00, 20.05.04, released in| |19.11.10 --- Comment #13 from Aleisha Amohia <aleisha@catalyst.net.nz> --- backported to 19.11.x for 19.11.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26271 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #14 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26271 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Call to |Call to |/api/v1/patrons/<patron_id> |/api/v1/patrons/{patron_id} |/account returns 500 error |/account returns 500 error |if manager_id is NULL |if manager_id is NULL -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org