[Bug 44012] New: Add ability to apply MARC mod template via Connexion import
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 Bug ID: 44012 Summary: Add ability to apply MARC mod template via Connexion import Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: jacob.omara@openfifth.co.uk Reporter: jacob.omara@openfifth.co.uk QA Contact: andrew@bywatersolutions.com CC: m.de.rooy@rijksmuseum.nl Depends on: 44011 Target Milestone: --- Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44011 [Bug 44011] Add ability to change record source via MARC mod template -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #1 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210662 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210662&action=edit Bug 44012: Add record source to import batches -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #2 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210663 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210663&action=edit Bug 44012: DO NOT PUSH - DBIC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #3 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210664 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210664&action=edit Bug 44012: Apply template record source when staging and committing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #4 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210665 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210665&action=edit Bug 44012: Accept modification template in svc/import_bib -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #5 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210666 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210666&action=edit Bug 44012: Forward modification template from Connexion daemon -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #6 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210667 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210667&action=edit Bug 44012: Add tests for record source in import batches -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #7 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210668 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210668&action=edit Bug 44012: (QA follow-up) Require set_record_sources when staging with a template -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #8 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Created attachment 210669 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210669&action=edit Bug 44012: (QA follow-up) Require set_record_sources in svc/import_bib -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 Jacob O'Mara <jacob.omara@openfifth.co.uk> 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=44012 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement allows the release notes| |Connexion daemon to be | |configured to apply a MARC | |modification template when | |importing records. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #9 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Test plan: 1. Create two record sources 2. Create two MARC modification templates, each updating record source to one of the source you created 3. Start two Connexion daemons (misc/bin/connexion_import_daemon.pl) with import_mode: direct, different ports and marc_modification_template_id set to the two templates. Send a compatible marc record to each port. Each new record shows its daemon's source and Manage staged records lists one webservice batch per daemon -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited| |CLAMS list of Sponsors| | Status|Signed Off |Passed QA Sponsorship status|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210662|0 |1 is obsolete| | Attachment #210663|0 |1 is obsolete| | Attachment #210664|0 |1 is obsolete| | Attachment #210665|0 |1 is obsolete| | Attachment #210666|0 |1 is obsolete| | Attachment #210667|0 |1 is obsolete| | Attachment #210668|0 |1 is obsolete| | Attachment #210669|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #10 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210729 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210729&action=edit Bug 44012: Add record source to import batches Test plan: 1. Apply all patches, run updatedatabase.pl and restart Plack 2. Administration > Record sources. Create two record sources. Cataloging > MARC modification templates. Create two templates without actions that each set one of the sources 3. Cataloging > Stage records for import. Upload a MARC file, pick the first template and stage. Open the job, click "View batch" and import the batch. The imported record shows the first source 4. Start two Connexion daemons (misc/bin/connexion_import_daemon.pl) with import_mode: direct, overlay_action: replace, nomatch_action: create_new, item_action: ignore, different ports and marc_modification_template_id set to the two templates. Send a compatible MARC record to each port. Each new record shows its daemon's source and Manage staged records lists one webservice batch per daemon 5. Run: prove t/db_dependent/ImportBatch.t Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #11 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210730 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210730&action=edit Bug 44012: DO NOT PUSH - DBIC Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #12 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210731 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210731&action=edit Bug 44012: Apply template record source when staging and committing Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #13 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210732 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210732&action=edit Bug 44012: Accept modification template in svc/import_bib Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #14 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210733 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210733&action=edit Bug 44012: Forward modification template from Connexion daemon Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #15 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210734 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210734&action=edit Bug 44012: Add tests for record source in import batches Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Sponsored-by: CLAMS Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #16 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210735 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210735&action=edit Bug 44012: (QA follow-up) Require set_record_sources when staging with a template Staging MARC records applies the selected modification template's record source to the import batch, and committing the batch then sets it on the records. tools/stage-marc-import.pl listed every template and accepted any template id, so a user with stage_marc_import but without editcatalogue:set_record_sources could assign a record source, which batch record modification already refuses. This patch hides templates that set a record source from users without the permission, and refuses a staging request that names one, as batch_record_modification.pl does. Test plan: 1. Create a MARC modification template and set a record source on it 2. As a staff user with tools permissions but without editcatalogue:set_record_sources, go to Cataloging > Stage records for import: the template is not listed 3. Run yarn cypress run --spec t/cypress/integration/Tools/MarcModificationTemplateRecordSource_spec.ts 4. All tests pass, including the forged staging POST being refused Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #17 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 210736 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210736&action=edit Bug 44012: (QA follow-up) Require set_record_sources in svc/import_bib svc/import_bib only requires editcatalogue:edit_catalogue, but it accepts a marc_modification_template_id and stamps that template's record source on the webservice batch and the records committed from it. Any cataloguer could therefore assign a record source through the webservice, bypassing the set_record_sources permission that batch record modification and staging enforce. This patch refuses the request with status 'failed' and error 'set_record_source_not_allowed' when the template sets a record source and the authenticated user lacks set_record_sources. Templates without a record source keep working as before. Test plan: 1. Run yarn cypress run --spec t/cypress/integration/Tools/MarcModificationTemplateRecordSource_spec.ts 2. All tests pass: a superlibrarian posting to svc/import_bib with a template that sets a record source gets status 'ok', and a user with only edit_catalogue gets status 'failed' with error 'set_record_source_not_allowed' Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #18 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This enhancement allows the |The Connexion import daemon release notes|Connexion daemon to be |can now apply a MARC |configured to apply a MARC |modification template to |modification template when |incoming records. Import |importing records. |batches store a record | |source, taken from the | |template, which is set on | |the records when the batch | |is committed. Staging with | |a template, and the | |`svc/import_bib` web | |service, follow the same | |rules. | | | |**Configuration** | |- Connexion daemon | |configuration: | |`marc_modification_template | |_id` (the numeric ID shown | |on Cataloging > MARC | |modification templates). | |Records are changed by the | |template before staging, | |and get the template's | |record source if it sets | |one. | | | |**Upgrade notes** | |- Only users with | |`editcatalogue > | |set_record_sources` can | |stage records with a | |template that sets a record | |source. Other users no | |longer see such templates | |when staging. | |- `svc/import_bib` returns | |`set_record_source_not_allo | |wed` to users without | |`editcatalogue > | |set_record_sources` when | |the template sets a record | |source. Templates without a | |record source work as | |before. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|The Connexion import daemon |This enhancement allows the release notes|can now apply a MARC |Connexion daemon to be |modification template to |configured to apply a MARC |incoming records. Import |modification template when |batches store a record |importing records. |source, taken from the | |template, which is set on | |the records when the batch | |is committed. Staging with | |a template, and the | |`svc/import_bib` web | |service, follow the same | |rules. | | | |**Configuration** | |- Connexion daemon | |configuration: | |`marc_modification_template | |_id` (the numeric ID shown | |on Cataloging > MARC | |modification templates). | |Records are changed by the | |template before staging, | |and get the template's | |record source if it sets | |one. | | | |**Upgrade notes** | |- Only users with | |`editcatalogue > | |set_record_sources` can | |stage records with a | |template that sets a record | |source. Other users no | |longer see such templates | |when staging. | |- `svc/import_bib` returns | |`set_record_source_not_allo | |wed` to users without | |`editcatalogue > | |set_record_sources` when | |the template sets a record | |source. Templates without a | |record source work as | |before. | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44012 --- Comment #19 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Hello, On 18 November I ran a bulk update of the "Text to go in release notes" field on bugs in the 26.11 range, to fill in missing notes using a consistent template. A mistake in that run also overwrote the release note you had written on this bug. That was not intended, and I am sorry for the noise. I have restored your original text from the bug history, so the field is exactly as you wrote it. Nothing else on this bug was changed. Thank you for writing the note. Martin -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org