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

(-)a/C4/AuthoritiesMarc.pm (-1 / +10 lines)
Lines 1315-1320 sub merge { Link Here
1315
        $oResult->destroy();
1315
        $oResult->destroy();
1316
    }
1316
    }
1317
    #warn scalar(@reccache)." biblios to update";
1317
    #warn scalar(@reccache)." biblios to update";
1318
    #Get a list of authority controlled subfields
1319
    $sth = $dbh->prepare("select distinct tagsubfield from auth_subfield_structure where authtypecode=? and tagfield=? and tab >=0 and hidden = 0");
1320
    $sth->execute($authtypecodeto, $auth_tag_to_report_to);
1321
    my @subfields_controlled_by_auth_to;
1322
    while (my ($tagsubfield) = $sth->fetchrow) {
1323
        push @subfields_controlled_by_auth_to, $tagsubfield ;
1324
    }
1318
    # Get All candidate Tags for the change 
1325
    # Get All candidate Tags for the change 
1319
    # (This will reduce the search scope in marc records).
1326
    # (This will reduce the search scope in marc records).
1320
    $sth = $dbh->prepare("select distinct tagfield from marc_subfield_structure where authtypecode=?");
1327
    $sth = $dbh->prepare("select distinct tagfield from marc_subfield_structure where authtypecode=?");
Lines 1346-1351 sub merge { Link Here
1346
                    $field_to->add_subfields($subfield->[0] =>$subfield->[1]);
1353
                    $field_to->add_subfields($subfield->[0] =>$subfield->[1]);
1347
		    $exclude.= $subfield->[0];
1354
		    $exclude.= $subfield->[0];
1348
                }
1355
                }
1356
		foreach my $subt (@subfields_controlled_by_auth_to) {
1357
		    $exclude.= $subt;
1358
		}
1349
		$exclude='['.$exclude.']';
1359
		$exclude='['.$exclude.']';
1350
#		add subfields in $field not included in @record_to
1360
#		add subfields in $field not included in @record_to
1351
		my @restore= grep {$_->[0]!~/$exclude/} $field->subfields();
1361
		my @restore= grep {$_->[0]!~/$exclude/} $field->subfields();
1352
- 

Return to bug 5572