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

(-)a/C4/AuthoritiesMarc.pm (-1 / +10 lines)
Lines 1338-1343 sub merge { Link Here
1338
        $oConnection->option("preferredRecordSyntax"=>$oldSyntax);
1338
        $oConnection->option("preferredRecordSyntax"=>$oldSyntax);
1339
    }
1339
    }
1340
    #warn scalar(@reccache)." biblios to update";
1340
    #warn scalar(@reccache)." biblios to update";
1341
    #Get a list of authority controlled subfields
1342
    $sth = $dbh->prepare("select distinct tagsubfield from auth_subfield_structure where authtypecode=? and tagfield=? and tab >=0 and hidden = 0");
1343
    $sth->execute($authtypecodeto, $auth_tag_to_report_to);
1344
    my @subfields_controlled_by_auth_to;
1345
    while (my ($tagsubfield) = $sth->fetchrow) {
1346
        push @subfields_controlled_by_auth_to, $tagsubfield ;
1347
    }
1341
    # Get All candidate Tags for the change 
1348
    # Get All candidate Tags for the change 
1342
    # (This will reduce the search scope in marc records).
1349
    # (This will reduce the search scope in marc records).
1343
    $sth = $dbh->prepare("select distinct tagfield from marc_subfield_structure where authtypecode=?");
1350
    $sth = $dbh->prepare("select distinct tagfield from marc_subfield_structure where authtypecode=?");
Lines 1370-1375 sub merge { Link Here
1370
                    $field_to->add_subfields($subfield->[0] =>$subfield->[1]);
1377
                    $field_to->add_subfields($subfield->[0] =>$subfield->[1]);
1371
		    $exclude.= $subfield->[0];
1378
		    $exclude.= $subfield->[0];
1372
                }
1379
                }
1380
		foreach my $subt (@subfields_controlled_by_auth_to) {
1381
		    $exclude.= $subt;
1382
		}
1373
		$exclude='['.$exclude.']';
1383
		$exclude='['.$exclude.']';
1374
#		add subfields in $field not included in @record_to
1384
#		add subfields in $field not included in @record_to
1375
		my @restore= grep {$_->[0]!~/$exclude/} $field->subfields();
1385
		my @restore= grep {$_->[0]!~/$exclude/} $field->subfields();
1376
- 

Return to bug 5572