Bug 16994 - Import and export MARC modification templates
Summary: Import and export MARC modification templates
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Arthur Suzuki
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-28 17:27 UTC by Owen Leonard
Modified: 2025-12-22 12:41 UTC (History)
11 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Describes the function (3.08 KB, text/markdown)
2025-12-16 21:39 UTC, Arthur Suzuki
Details
Bug 16994: Import and export MARC modification templates (16.46 KB, patch)
2025-12-16 21:47 UTC, Arthur Suzuki
Details | Diff | Splinter Review
Bug 16994: Add unit tests (10.00 KB, patch)
2025-12-16 22:59 UTC, Arthur Suzuki
Details | Diff | Splinter Review
Bug 16994: Import and export MARC modification templates (16.51 KB, patch)
2025-12-19 20:03 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 16994: Add unit tests (10.05 KB, patch)
2025-12-19 20:03 UTC, Roman Dolny
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2016-07-28 17:27:34 UTC
Configuring a complicated MARC modification template can be a tedious job, so it would be nice to be able to import and export them the way we can with MARC frameworks. This would also facilitate sharing between libraries.
Comment 1 Magnus Enger 2016-08-04 07:23:51 UTC
Maybe something for Mana? See bug 17047.
Comment 2 Paul Poulain 2019-01-31 11:21:23 UTC
yes, something for mana, for sure !
Mana is now pushed. BibLibre developers have a lot of things pending, but I add this idea in my radar (maybe something for an intern in the future ? ;) )
Comment 3 Kelly McElligott 2020-06-08 13:50:48 UTC
This would be awesome in Mana!  My first thought was exporting - as Owen commented, but Mana would be way easier and cooler.
Comment 4 Barbara Johnson 2021-04-27 17:01:10 UTC
I just had an instance where being able to export and import a MARC Modification template would have been helpful.  We'd love to have this functionality.  And being able to discover templates from other libraries would be great.
Comment 5 AspenCat Team 2021-12-01 03:01:07 UTC
I like to test our marc modification template in sandbox.  If successful and complicated it would be nice to be able to move to production without manually copying each line.  I would also like to see a library that we could borrow modification templates.
Comment 6 Arthur Suzuki 2025-12-16 21:39:25 UTC
Created attachment 190560 [details]
Describes the function
Comment 7 Arthur Suzuki 2025-12-16 21:47:39 UTC
Created attachment 190561 [details] [review]
Bug 16994: Import and export MARC modification templates

This patch adds export and import functions to the MarcModificationTemplates tools
The different templates can be exported either individually or all of them.
On import you can choose to either skip or overwrite existing templates with the same name.

Test plan:
- create a Marc Modification templates with one field creation action.
- click on "Export all" in the menu and save the file on your computer.
- add a new action in the template (ie, update field).
- click on "Import" in the menu and choose the downloaded file.
- by default the import tool doesn't overwrite
- there should be a message saying "skipped 1 template"
- the template should still have 2 actions.
- import the same file again but uncheck the "skip existing template".
- this time the template should be back to only one action.
- delete the template
- import the same file again, the template should be back with a single action.
Comment 8 Arthur Suzuki 2025-12-16 21:51:29 UTC
I've provided a first patch with the whole functionality available but it still needs at least proper unit tests to pass the QA.
Comment 9 Arthur Suzuki 2025-12-16 22:59:53 UTC
Created attachment 190563 [details] [review]
Bug 16994: Add unit tests
Comment 10 Roman Dolny 2025-12-19 20:03:41 UTC
Created attachment 190647 [details] [review]
Bug 16994: Import and export MARC modification templates

This patch adds export and import functions to the MarcModificationTemplates tools
The different templates can be exported either individually or all of them.
On import you can choose to either skip or overwrite existing templates with the same name.

Test plan:
- create a Marc Modification templates with one field creation action.
- click on "Export all" in the menu and save the file on your computer.
- add a new action in the template (ie, update field).
- click on "Import" in the menu and choose the downloaded file.
- by default the import tool doesn't overwrite
- there should be a message saying "skipped 1 template"
- the template should still have 2 actions.
- import the same file again but uncheck the "skip existing template".
- this time the template should be back to only one action.
- delete the template
- import the same file again, the template should be back with a single action.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 11 Roman Dolny 2025-12-19 20:03:45 UTC
Created attachment 190648 [details] [review]
Bug 16994: Add unit tests

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>