Bugzilla – Attachment 127093 Details for
Bug 26402
Add --framework parameter to commit_file.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26402: Add --framework parameter to commit_file.pl
Bug-26402-Add---framework-parameter-to-commitfilep.patch (text/plain), 2.44 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-10-29 11:05:56 UTC
(
hide
)
Description:
Bug 26402: Add --framework parameter to commit_file.pl
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-10-29 11:05:56 UTC
Size:
2.44 KB
patch
obsolete
>From 38df23e19080071cd16955680f0b878cae21e8f1 Mon Sep 17 00:00:00 2001 >From: Andreas Jonsson <andreas.jonsson@kreablo.se> >Date: Mon, 7 Sep 2020 09:31:58 +0000 >Subject: [PATCH] Bug 26402: Add --framework parameter to commit_file.pl > >This patch adds the option to pass a frameworkcode to the commit_file.pl >script. > >To test: >1. Stage a MARC file using stage_file.pl. For instance using the devbox: > > cd ~/kohaclone > sudo koha-shell -c 'perl misc/stage_file.pl --file t/db_dependent/www/data/marc21record.mrc' kohadev > >2. Note the assigned batch number and commit the batch using --framework parameter to commit_file.pl. For example using the devbox: > > sudo koha-shell -c 'perl misc/commit_file.pl --batch-number 1 --framework ACQ' kohadev > >3. Verify that the framework code was correctly assigned: > > sudo koha-mysql kohadev -e 'SELECT frameworkcode FROM biblio ORDER BY timestamp DESC LIMIT 1;' >=> SUCCESS: It picked it > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > misc/commit_file.pl | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/misc/commit_file.pl b/misc/commit_file.pl >index efabdfc429..543d7b06c7 100755 >--- a/misc/commit_file.pl >+++ b/misc/commit_file.pl >@@ -21,10 +21,12 @@ my $batch_number = ""; > my $list_batches = 0; > my $revert = 0; > my $want_help = 0; >+my $framework = ''; > > my $result = GetOptions( > 'batch-number:s' => \$batch_number, > 'list-batches' => \$list_batches, >+ 'framework:s' => \$framework, > 'revert' => \$revert, > 'h|help' => \$want_help > ); >@@ -84,7 +86,7 @@ sub process_batch { > > print "... importing MARC records -- please wait\n"; > my ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored) = >- BatchCommitRecords($import_batch_id, '', 100, \&print_progress_and_commit); >+ BatchCommitRecords($import_batch_id, $framework, 100, \&print_progress_and_commit); > print "... finished importing MARC records\n"; > > print <<_SUMMARY_; >@@ -145,6 +147,8 @@ stage_file.pl or by the Koha Tools option > Parameters: > --batch-number <#> number of the record batch > to import >+ --framework <code> add new records using this framework. If >+ omitted, the default framework is used. > --list-batches print a list of record batches > available to commit > --revert revert a batch instead of importing it >-- >2.33.1
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 26402
:
109690
|
127093
|
127203