Bugzilla – Attachment 68240 Details for
Bug 19164
Allow MARC modification templates to be used in staged MARC imports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19164 - Allow MARC modification templates to be used in staged MARC imports
Bug-19164---Allow-MARC-modification-templates-to-b.patch (text/plain), 2.51 KB, created by
Jon Knight
on 2017-10-18 10:24:56 UTC
(
hide
)
Description:
Bug 19164 - Allow MARC modification templates to be used in staged MARC imports
Filename:
MIME Type:
Creator:
Jon Knight
Created:
2017-10-18 10:24:56 UTC
Size:
2.51 KB
patch
obsolete
>From 6fd6443d831c5b2e01cefc7c5c906a7bbbd08575 Mon Sep 17 00:00:00 2001 >From: Jon Knight <J.P.Knight@lboro.ac.uk> >Date: Wed, 11 Oct 2017 20:22:06 +0000 >Subject: [PATCH] Bug 19164 - Allow MARC modification templates to be used in > staged MARC imports > >Patch checkes 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: >--- > misc/stage_file.pl | 25 +++++++++++++++++++++---- > 1 file changed, 21 insertions(+), 4 deletions(-) > >diff --git a/misc/stage_file.pl b/misc/stage_file.pl >index 0c4dece..6d045ca 100755 >--- a/misc/stage_file.pl >+++ b/misc/stage_file.pl >@@ -19,8 +19,9 @@ > # with this program; if not, write to the Free Software Foundation, Inc., > # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > >-use strict; >-use warnings; >+#use strict; >+#use warnings; >+use Modern::Perl; > BEGIN { > # find Koha's Perl modules > # test carefully before changing this >@@ -74,7 +75,18 @@ if($marc_mod_template ne '') { > $marc_mod_template_id = $this_template->{'template_id'}; > last; > } >+ if($this_template->{'name'} eq $marc_mod_template) { >+ if($marc_mod_template_id < 0) { >+ $marc_mod_template_id = $this_template->{'template_id'}; >+ } else { >+ print "WARNING: MARC modification template name " . >+ "'$marc_mod_template' matches multiple templates. " . >+ "Please fix this issue before proceeding.\n"; >+ exit 1; >+ } >+ } > } >+ > if($marc_mod_template_id < 0) { > die "Can't locate MARC modification template '$marc_mod_template'\n"; > } >@@ -134,8 +146,13 @@ sub process_batch { > print "... staging MARC records -- please wait\n"; > #FIXME: We should really allow the use of marc modification frameworks and to_marc plugins here if possible > my ($batch_id, $num_valid_records, $num_items, @import_errors) = >- BatchStageMarcRecords($record_type, $params->{encoding}, $marc_records, $params->{input_file}, $params->{'marc_mod_template_id'}, undef, $params->{batch_comment}, '', $params->{add_items}, 0, >- 100, \&print_progress_and_commit); >+ BatchStageMarcRecords( >+ $record_type, $params->{encoding}, >+ $marc_records, $params->{input_file}, >+ $params->{'marc_mod_template_id'}, >+ $params->{batch_comment}, '', >+ $params->{add_items}, 0, >+ 100, \&print_progress_and_commit); > print "... finished staging MARC records\n"; > > my $num_with_matches = 0; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19164
:
66351
|
68239
|
68240
|
68249
|
68341
|
68425
|
70033
|
84167
|
84982
|
84987
|
84988