[Bug 21219] New: NULL values in updated_on field break the Patrons REST API
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21219 Bug ID: 21219 Summary: NULL values in updated_on field break the Patrons REST API Change sponsored?: --- Product: Koha Version: 18.05 Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: REST api Assignee: koha-bugs@lists.koha-community.org Reporter: koha@jsense.co.uk The swagger definition does not allow for updated_on to be NULL but the database does allow this. If a patron has a null value then the REST service call fails. The history of this is as follows: Bug #10459 (released in 16.05.01) - updated_on field added to borrowers table, NULL allowed Bug #17651 (released in 16.11) - fix swagger definition to allow for NULL "updated_on": { - "type": "string", + "type": ["string", "null"], "description": "time of last change could be useful for synchronization with external systems (among others)" }, Bug #16330 (released in 18.05) - removes the null option from the definition "updated_on": { - "type": ["string", "null"], + "type": "string", "format": "date-time", "description": "time of last change could be useful for synchronization with external systems (among others)" }, You can see that the last push undid the previous bug fix. -- 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=21219 Pete Edwards <koha@jsense.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=16330 -- 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=21219 Pete Edwards <koha@jsense.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=17651 -- 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=21219 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Version|18.05 |master 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=21219 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |In Discussion --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I looked at all the branches down to 16.05.x and they all seem to have NOT NULL on the table definition. Maybe this is an update process bug. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21219 --- Comment #2 from Pete Edwards <koha@jsense.co.uk> --- I did wonder whether it could be an update issue but I couldn't find any evidence of a script that would have set a value on the column for existing records when the column was added. Does simply changing the column definition to "NOT NULL" cause the default timestamp to be set - if so I really don't understand why it was created with "NULL". Obviously, this leaves me concerned that there could be other other discrepancies - is there an easy way to compare my actual schema to the one the should be installed - I installed v18.05 but my database has the column defined as: `updated_on` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Thanks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21219 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=21402 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21219 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Pete Edwards from comment #2)
I installed v18.05 but my database has the column defined as:
`updated_on` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
borrowers.updated_on has been added by bug 10459, and it was already NOT NULL. Did you mean you did a fresh 18.05(.00?) install and you got this table definition? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21219 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |RESOLVED Resolution|--- |INVALID -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org