[Bug 27853] New: POST /patrons doesn't enforce mandatory extended attributes
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27853 Bug ID: 27853 Summary: POST /patrons doesn't enforce mandatory extended attributes 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: tomascohen@gmail.com If there are extended attributes types that are mandatory, the POST /patrons route should fail if the request doesn't meet this requirement. Unfortunately, we have no way (yet) to pass extended attributes on the POST. So to solve this bug, we need to add a way to pass extended attributes along with the patron object. I propose: POST /patrons { "first_name": "Tomasito", ... "extended_attributes": { "SHOW_BCODE": [ 1 ], "COURSES": [ "ALGO1", "DATABASES" ] } } I choose to force them to be arrays for simplicity (they can be repeatable), but we can check the data type on the controller (i.e. if ( ref($extended_attributes) eq 'ARRAY') { # loop case } else { # scalar case } ). I'm open for opinions. -- 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=27853 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=23666 -- 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=27853 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org, | |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=27853 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@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=27853 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- How about an array of extended_attribute objects? "extended_attributes": [ { "type": "whatever", "code": "yup" }, { "type": "another", "code": "top" } ] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27853 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |27854 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27854 [Bug 27854] Clean GET /patrons controller -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27853 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|27854 |27855, 27857 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27854 [Bug 27854] Clean GET /patrons controller https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27855 [Bug 27855] Allow embedding extended_attributes on /patrons routes https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27857 [Bug 27857] Koha::Patron->extended_attributes skips checks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27853 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joonas.kylmala@helsinki.fi --- Comment #2 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- At least the "Unique identifier" attribute check should be added as well there if it will be possible to add mandatory attribute in the future. And probably the same goes for checking the "Repeatable" attribute property. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27853 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Joonas Kylmälä from comment #2)
At least the "Unique identifier" attribute check should be added as well there if it will be possible to add mandatory attribute in the future. And probably the same goes for checking the "Repeatable" attribute property.
Yes! That's handled on bug 27857, in which this will rely. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27853 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ephetteplace@cca.edu -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org