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

(-)a/C4/AuthoritiesMarc.pm (-4 / +9 lines)
Lines 692-698 Deletes $authid and calls merge to cleanup in linked biblio records Link Here
692
sub DelAuthority {
692
sub DelAuthority {
693
    my ($authid) = @_;
693
    my ($authid) = @_;
694
    my $dbh=C4::Context->dbh;
694
    my $dbh=C4::Context->dbh;
695
    merge({ mergefrom => $authid, MARCfrom => GetAuthority($authid) });
695
    merge({ mergefrom => $authid });
696
    $dbh->do( "DELETE FROM auth_header WHERE authid=?", undef, $authid );
696
    $dbh->do( "DELETE FROM auth_header WHERE authid=?", undef, $authid );
697
    logaction( "AUTHORITIES", "DELETE", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog");
697
    logaction( "AUTHORITIES", "DELETE", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog");
698
    ModZebra( $authid, "recordDelete", "authorityserver", undef);
698
    ModZebra( $authid, "recordDelete", "authorityserver", undef);
Lines 1370-1376 sub AddAuthorityTrees{ Link Here
1370
1370
1371
    $count = merge({
1371
    $count = merge({
1372
        mergefrom => mergefrom,
1372
        mergefrom => mergefrom,
1373
        MARCfrom => $MARCfrom,
1373
        [ MARCfrom => $MARCfrom, ]
1374
        [ mergeto => $mergeto, ]
1374
        [ mergeto => $mergeto, ]
1375
        [ MARCto => $MARCto, ]
1375
        [ MARCto => $MARCto, ]
1376
        [ biblionumbers => [ $a, $b, $c ], ]
1376
        [ biblionumbers => [ $a, $b, $c ], ]
Lines 1382-1387 If $mergeto equals mergefrom, the linked biblio field is updated. Link Here
1382
If $mergeto is different, the biblio field will be linked to $mergeto.
1382
If $mergeto is different, the biblio field will be linked to $mergeto.
1383
If $mergeto is missing, the biblio field is deleted.
1383
If $mergeto is missing, the biblio field is deleted.
1384
1384
1385
MARCfrom and MARCto are not needed when merging deleted authority records.
1386
MARCfrom is used to determine if a cleared subfield in the authority record
1387
should be removed from a biblio. MARCto is used to populate the biblio
1388
record with the updated values. So it is not optional when merging
1389
existing records!
1390
1385
Normally all biblio records linked to $mergefrom, will be considered. But
1391
Normally all biblio records linked to $mergefrom, will be considered. But
1386
you can pass specific numbers via the biblionumbers parameter.
1392
you can pass specific numbers via the biblionumbers parameter.
1387
1393
Lines 1436-1442 sub merge { Link Here
1436
    my @record_from;
1442
    my @record_from;
1437
    @record_from = $MARCfrom->field($auth_tag_to_report_from)->subfields() if $auth_tag_to_report_from && $MARCfrom && $MARCfrom->field($auth_tag_to_report_from);
1443
    @record_from = $MARCfrom->field($auth_tag_to_report_from)->subfields() if $auth_tag_to_report_from && $MARCfrom && $MARCfrom->field($auth_tag_to_report_from);
1438
1444
1439
    # Get All candidate Tags for the change 
1445
    # Get all candidate tags for the change
1440
    # (This will reduce the search scope in marc records).
1446
    # (This will reduce the search scope in marc records).
1441
    # For a deleted authority record, we scan all auth controlled fields
1447
    # For a deleted authority record, we scan all auth controlled fields
1442
    my $dbh = C4::Context->dbh;
1448
    my $dbh = C4::Context->dbh;
1443
- 

Return to bug 9988