[Bug 31801] New: REST API: PUT endpoint for Biblios
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Bug ID: 31801 Summary: REST API: PUT endpoint for Biblios Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: new feature Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com 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=31801 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored Blocks| |31788 Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31788 [Bug 31788] REST API: CRUD endpoints for Biblios [omnibus] -- 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=31801 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|tomascohen@gmail.com |agustinmoyano@theke.io -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30799 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |31800 Status|NEW |ASSIGNED Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31800 [Bug 31800] REST API: POST endpoint for Biblios -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 --- Comment #1 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 144832 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144832&action=edit Bug 31801: Add REST endpoint to modify a biblio To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Pick a biblio to modify, and modify it's marc record 4. Make a PUT request to /api/v1/biblios/:biblionumber with one of the following content type header - application/json - application/marcxml+xml - application/marc-in-json - application/marc 5. If content type is other than 'application/json' place the following header in the request 'x-framework-id: <framework id>' 5. Check that the biblio was modified 6. Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144832|0 |1 is obsolete| | --- Comment #2 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 144836 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144836&action=edit Bug 31801: Add REST endpoint to modify a biblio To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Pick a biblio to modify, and modify it's marc record 4. Make a PUT request to /api/v1/biblios/:biblionumber with one of the following content type header - application/marcxml+xml - application/marc-in-json - application/marc 5. Add the following header in the request 'x-framework-id: <framework id>' 5. Check that the biblio was modified 6. Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144836|0 |1 is obsolete| | --- Comment #3 from Agustín Moyano <agustinmoyano@theke.io> --- Created attachment 144838 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144838&action=edit Bug 31801: Add REST endpoint to modify a biblio To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Pick a biblio to modify, and modify it's marc record 4. Make a PUT request to /api/v1/biblios/:biblionumber with one of the following content type header - application/marcxml+xml - application/marc-in-json - application/marc 5. Add the following header in the request 'x-framework-id: <framework id>' 5. Check that the biblio was modified 6. Sign off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Trivial patch |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bibliothek@th-wildau.de --- Comment #4 from Jan Kissig <bibliothek@th-wildau.de> --- Great that this route is going to be implemented in core. There is plugin available at https://github.com/NatLibFi/koha-plugin-rest-biblios. I found that if MARCOverlayRules are used, f.e. protect field 100 from being overwritten, the field is overwritten if api is used. Can you verify this? A modified test plan would be 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Add Marc overlay rule in administration / MARC overlay rules module = source filter = * tag = 001 preset = protect 4. Set MARCOverlayRules to Use in system prefs 5. Pick a biblio to modify, and modify it's marc record especially field 001 6. Make a PUT request to /api/v1/biblios/:biblionumber with one of the following content type header - application/marcxml+xml - application/marc-in-json - application/marc 7. Add the following header in the request 'x-framework-id: <framework id>' 8. Check that the biblio was modified but not field 001 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 --- Comment #5 from Jan Kissig <bibliothek@th-wildau.de> --- To respect MARCOverlayRules the call of ModBiblio could be extended like this: ModBiblio( $record, $biblionumber, $frameworkcode, { overlay_context => { source => 'API biblios' } } ); Shall i write another patch or can you change the line? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Agustín Moyano <agustinmoyano@theke.io> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |32734 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32734 [Bug 32734] REST API: Add a list endpoint for Biblios -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com, | |hammat.wele@inlibro.com, | |maryse.simard@inlibro.com, | |olivier.hubert@inlibro.com, | |philippe.blouin@inlibro.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Hammat wele <hammat.wele@inlibro.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=31801 Hammat wele <hammat.wele@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144838|0 |1 is obsolete| | --- Comment #6 from Hammat wele <hammat.wele@inlibro.com> --- Created attachment 147146 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147146&action=edit Bug 31801: Add REST endpoint to modify a biblio To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Pick a biblio to modify, and modify it's marc record 4. Make a PUT request to /api/v1/biblios/:biblionumber with one of the following content type header - application/marcxml+xml - application/marc-in-json - application/marc 5. Add the following header in the request 'x-framework-id: <framework id>' 5. Check that the biblio was modified 6. Sign off Signed-off-by: Hammat Wele <hammat.wele@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com 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=31801 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=31801 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147146|0 |1 is obsolete| | --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 147718 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147718&action=edit Bug 31801: Add REST endpoint to modify a biblio To test: 1. Apply patch 2. Set RESTBasicAuth preference to true 3. Pick a biblio to modify, and modify it's marc record 4. Make a PUT request to /api/v1/biblios/:biblionumber with one of the following content type header - application/marcxml+xml - application/marc-in-json - application/marc 5. Add the following header in the request 'x-framework-id: <framework id>' 5. Check that the biblio was modified 6. Sign off Signed-off-by: Hammat Wele <hammat.wele@inlibro.com> 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=31801 --- Comment #8 from Jan Kissig <bibliothek@th-wildau.de> --- I am sorry to ask again (see comment #4 & #5). Shouldn't this route respect MARCOverlayRules, if set in Administration? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jan Kissig from comment #5)
To respect MARCOverlayRules the call of ModBiblio could be extended like this:
ModBiblio( $record, $biblionumber, $frameworkcode, { overlay_context => { source => 'API biblios' } } );
Shall i write another patch or can you change the line?
Since Jan already provided the solution - how can we best move forward here? I agree that the rules should be respected. Maybe we could move the change to a separate bug and also extend the 'filters' pull-down list on the overly rules administration page with an API entry. Not sure if a new source needs to be defined in other spots as well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Katrin Fischer from comment #9)
(In reply to Jan Kissig from comment #5)
To respect MARCOverlayRules the call of ModBiblio could be extended like this:
ModBiblio( $record, $biblionumber, $frameworkcode, { overlay_context => { source => 'API biblios' } } );
Shall i write another patch or can you change the line?
Since Jan already provided the solution - how can we best move forward here? I agree that the rules should be respected.
Maybe we could move the change to a separate bug and also extend the 'filters' pull-down list on the overly rules administration page with an API entry. Not sure if a new source needs to be defined in other spots as well.
I agree, but this is gonna be more complex :-D We are adding a new table for record sources on bug 32607 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jan Kissig from comment #5)
To respect MARCOverlayRules the call of ModBiblio could be extended like this:
ModBiblio( $record, $biblionumber, $frameworkcode, { overlay_context => { source => 'API biblios' } } );
This is an interesting point. If we think we will eventually replace our current code with an API-driven UI, having an 'API biblios' record source doesn't feel useful. That's why we are introducing the concept of configurable record sources on bug 32607. With that in mind, the record source will be undefined in case of regular cataloguing, or a specific one based on a header with an allow list of users that can impersonate the record source. Once we have that, we can move the cataloguing sources in the MARC overlay rules pages into the record sources tables, and adapt the code so it is used from there. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 --- Comment #12 from Jan Kissig <bibliothek@th-wildau.de> --- (In reply to Tomás Cohen Arazi from comment #11)
(In reply to Jan Kissig from comment #5)
To respect MARCOverlayRules the call of ModBiblio could be extended like this:
ModBiblio( $record, $biblionumber, $frameworkcode, { overlay_context => { source => 'API biblios' } } );
This is an interesting point. If we think we will eventually replace our current code with an API-driven UI, having an 'API biblios' record source doesn't feel useful.
That's why we are introducing the concept of configurable record sources on bug 32607. With that in mind, the record source will be undefined in case of regular cataloguing, or a specific one based on a header with an allow list of users that can impersonate the record source.
Once we have that, we can move the cataloguing sources in the MARC overlay rules pages into the record sources tables, and adapt the code so it is used from there.
source => 'API biblios' in my comment #5 was just something like a placeholder for me and I didn't find anything that suited for the API routes. But without overlay_context any MARC overlay rules will be checked. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.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=31801 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Jacob O'Mara <jacob.omara@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.05.00 |23.05.00,22.11.04 released in| | 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=31801 --- Comment #14 from Jacob O'Mara <jacob.omara@ptfs-europe.com> --- Nice work, thanks everyone! Pushed to 22.11.x for the next release. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Bug 31801 depends on bug 31800, which changed state. Bug 31800 Summary: REST API: POST endpoint for Biblios https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31800 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #15 from Julian Maurice <julian.maurice@biblibre.com> --- *** Bug 30799 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|new feature |enhancement 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=31801 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED CC| |lucas@bywatersolutions.com Resolution|--- |FIXED --- Comment #16 from Lucas Gass <lucas@bywatersolutions.com> --- Enhancement will no be backported to 22.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|REST API: PUT endpoint for |Add PUT endpoint for |Biblios |Biblios Severity|enhancement |new feature -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31801 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35380 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35380 [Bug 35380] PUT /biblios/:biblio_id doesn't respect overlay rules -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org