Bugzilla – Attachment 13351 Details for
Bug 9012
Allow bulkmarcimport to specify a framework code when importing MARC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 9012 - --framework option for bulkmarcimport
Bug-9012-----framework-option-for-bulkmarcimport.patch (text/plain), 4.16 KB, created by
Kyle M Hall (khall)
on 2012-11-09 15:27:26 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 9012 - --framework option for bulkmarcimport
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2012-11-09 15:27:26 UTC
Size:
4.16 KB
patch
obsolete
>From 74fe5d47dbee1efe76a70dac88ff965290491957 Mon Sep 17 00:00:00 2001 >From: Robin Sheat <robin@catalyst.net.nz> >Date: Tue, 6 Nov 2012 17:48:23 +1300 >Subject: [PATCH] Bug 9012 - --framework option for bulkmarcimport >Content-Type: text/plain; charset="utf-8" > >This allows the --framework option to be specified when running >bulkmarkimport. This option allows a framework code to be specified for >the records being imported. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > misc/migration_tools/bulkmarcimport.pl | 18 +++++++++++++----- > 1 files changed, 13 insertions(+), 5 deletions(-) > >diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl >index a9fee95..894138d 100755 >--- a/misc/migration_tools/bulkmarcimport.pl >+++ b/misc/migration_tools/bulkmarcimport.pl >@@ -35,6 +35,7 @@ my ( $input_marc_file, $number, $offset) = ('',0,0); > my ($version, $delete, $test_parameter, $skip_marc8_conversion, $char_encoding, $verbose, $commit, $fk_off,$format,$biblios,$authorities,$keepids,$match, $isbn_check, $logfile); > my $cleanisbn = 1; > my ($sourcetag,$sourcesubfield,$idmapfl, $dedup_barcode); >+my $framework = ''; > > $|=1; > >@@ -62,6 +63,7 @@ GetOptions( > 'idmap:s' => \$idmapfl, > 'cleanisbn!' => \$cleanisbn, > 'dedupbarcode' => \$dedup_barcode, >+ 'framework=s' => \$framework, > ); > $biblios=!$authorities||$biblios; > >@@ -154,7 +156,7 @@ if ($authorities){ > } > else { > ( $tagid, $subfieldid ) = >- GetMarcFromKohaField( "biblio.biblionumber", '' ); >+ GetMarcFromKohaField( "biblio.biblionumber", $framework ); > $tagid||="001"; > } > >@@ -308,7 +310,7 @@ RECORD: while ( ) { > } > else > { >- eval { ( $biblionumber, $biblioitemnumber ) = AddBiblio($record, '', { defer_marc_save => 1 }) }; >+ eval { ( $biblionumber, $biblioitemnumber ) = AddBiblio($record, $framework, { defer_marc_save => 1 }) }; > } > if ( $@ ) { > warn "ERROR: Adding biblio $biblionumber failed: $@\n"; >@@ -326,7 +328,7 @@ RECORD: while ( ) { > C4::Biblio::_strip_item_fields($clone_record, ''); > # This sets the marc fields if there was an error, and also calls > # defer_marc_save. >- ModBiblioMarc( $clone_record, $biblionumber, '' ); >+ ModBiblioMarc( $clone_record, $biblionumber, $framework ); > if ( $error_adding ) { > warn "ERROR: Adding items to bib $biblionumber failed: $error_adding"; > printlog({id=>$id||$originalid||$biblionumber, op=>"insertitem",status=>"ERROR"}) if ($logfile); >@@ -339,7 +341,7 @@ RECORD: while ( ) { > } > if ($dedup_barcode && grep { exists $_->{error_code} && $_->{error_code} eq 'duplicate_barcode' } @$errors_ref) { > # Find the record called 'barcode' >- my ($tag, $sub) = C4::Biblio::GetMarcFromKohaField('items.barcode', ''); >+ my ($tag, $sub) = C4::Biblio::GetMarcFromKohaField('items.barcode', $framework); > # Now remove any items that didn't have a duplicate_barcode error, > # erase the barcodes on items that did, and re-add those items. > my %dupes; >@@ -372,7 +374,7 @@ RECORD: while ( ) { > printlog({id=>$id||$originalid||$biblionumber, op=>"insertitem",status=>"ERROR"}) if ($logfile); > # if we failed because of an exception, assume that > # the MARC columns in biblioitems were not set. >- ModBiblioMarc( $record, $biblionumber, '' ); >+ ModBiblioMarc( $record, $biblionumber, $framework ); > next RECORD; > } else { > printlog({id=>$id||$originalid||$biblionumber, op=>"insert",status=>"ok"}) if ($logfile); >@@ -594,6 +596,12 @@ to add the record is retried, thereby giving the record a blank barcode. This > is useful when something has set barcodes to be a biblio ID, or similar > (usually other software.) > >+=item B<-framework> >+ >+This is the code for the framework that the requested records will have attached >+to them when they are created. If not specified, then the default framework >+will be used. >+ > =back > > =cut >-- >1.7.2.5
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 9012
:
13275
|
13351
|
13824