Bug 19164: Add MARC modification template support to misc/stage-file.pl.
authorJon Knight <J.P.Knight@lboro.ac.uk>
Mon, 11 Feb 2019 15:50:30 +0000 (15:50 +0000)
committerroot <root@f1ebe1bec408>
Tue, 19 Feb 2019 13:52:15 +0000 (13:52 +0000)
commit1513c97b59a9faafeca2c5147b5cc65c4d2fd37c
tree0136262bdbd4517891cf3fcdf6dbc5b2f231b657
parent5b0eb51c8066abbd645731593572277ca5b46715
Bug 19164: Add MARC modification template support to misc/stage-file.pl.

https://bugs.koha-community.org/show_bug.cgi?id=19164

Bug 19164 - Allow MARC modification templates to be used in staged MARC imports

Patch checks for duplicate MARC modificiation templates and if only one is
found that matches the name given on the command line, submits the batch
staging of the input files using that template.

Test plan:

1) In the staff web client got to "Home › Tools › MARC modification templates" and create a MARC Modification Template called "Test Bug 19164". Set the action to be "Copy field 999$l to 998$l using RegEx s/NASH/FLASH/ if 999$l matches NASH"

2) Download the test MARC record from this bug into a file called marc1.mrc into your koha dev user's home directory.

3) Run misc/stage_file.pl with the command line:

   misc/stage_file.pl --file ~/marc1.mrc --add-items --marcmodtemplate "Test Bug 19164" --item-action replace --comment "testing MARC mod templates on batch staging"

4) In the staff client, go to Home › Tools › Manage staged MARC records and check that the file is visible and in status "Staged"

5) Click on the filename to bring up details of the staged batch, and then click on "Basic Christianity. Stott, John R. W. (0802811892)". Note that there is a 998$l field with the value "FLASH" that has been created using the MARC Modification Template.

Signed-off-by: Mackey Johnstone <mackeyfj@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
misc/stage_file.pl