View | Details | Raw Unified | Return to bug 35591
Collapse All | Expand All

(-)a/misc/migration_tools/bulkmarcimport.pl (-4 / +16 lines)
Lines 50-55 my $framework = ''; Link Here
50
my $localcust;
50
my $localcust;
51
my $marc_mod_template = '';
51
my $marc_mod_template = '';
52
my $marc_mod_template_id = -1;
52
my $marc_mod_template_id = -1;
53
my $guess_auth_id        = 1;
53
54
54
$|=1;
55
$|=1;
55
56
Lines 87-92 GetOptions( Link Here
87
    'framework=s' => \$framework,
88
    'framework=s' => \$framework,
88
    'custom:s'    => \$localcust,
89
    'custom:s'    => \$localcust,
89
    'marcmodtemplate:s' => \$marc_mod_template,
90
    'marcmodtemplate:s' => \$marc_mod_template,
91
    'guessauthid!'      => \$guess_auth_id,
90
);
92
);
91
$biblios ||= !$authorities;
93
$biblios ||= !$authorities;
92
$insert  ||= !$update;
94
$insert  ||= !$update;
Lines 385-392 RECORD: while ( ) { Link Here
385
    }
387
    }
386
    unless ($test_parameter) {
388
    unless ($test_parameter) {
387
        if ($authorities){
389
        if ($authorities){
388
            my $authtypecode=GuessAuthTypeCode($record, $heading_fields);
390
            my $authtypecode = GuessAuthTypeCode($record, $heading_fields);
389
            my $authid= ($id?$id:GuessAuthId($record));
391
            my $authid       = $id;
392
            if (!$authid && $guess_auth_id) {
393
                $authid = GuessAuthId($record);
394
            }
390
            if ($authid && GetAuthority($authid) && $update ){
395
            if ($authid && GetAuthority($authid) && $update ){
391
            ## Authority has an id and is in database : Replace
396
            ## Authority has an id and is in database : Replace
392
                eval { ( $authid ) = ModAuthority($authid,$record, $authtypecode) };
397
                eval { ( $authid ) = ModAuthority($authid,$record, $authtypecode) };
Lines 397-403 RECORD: while ( ) { Link Here
397
				else{
402
				else{
398
					printlog({id=>$originalid||$id||$authid, op=>"edit",status=>"ok"}) if ($logfile);
403
					printlog({id=>$originalid||$id||$authid, op=>"edit",status=>"ok"}) if ($logfile);
399
				}
404
				}
400
            }  
405
            }
401
	        else {
406
	        else {
402
            ## True insert in database
407
            ## True insert in database
403
                eval { ( $authid ) = AddAuthority($record,"", $authtypecode) };
408
                eval { ( $authid ) = AddAuthority($record,"", $authtypecode) };
Lines 823-828 modification template to apply as the MARC records are imported (these Link Here
823
templates are created in the "MARC modification templates" tool in Koha).
828
templates are created in the "MARC modification templates" tool in Koha).
824
If not specified, no MARC modification templates are used (default).
829
If not specified, no MARC modification templates are used (default).
825
830
831
=item B<--guessauthid>
832
833
Keep the buggy behaviour to guess the auth-id based on control-number (001).
834
This might overwrite your local auth_headers if the imported auth_headers 001
835
randomly matches the auth_id of one of your local auth_headers. See Bug#35591
836
837
Use --noguessauthid to prevent this buggy behaviour.
838
826
=back
839
=back
827
840
828
=cut
841
=cut
829
- 

Return to bug 35591