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

(-)a/C4/AuthoritiesMarc.pm (-1 / +6 lines)
Lines 29-35 use C4::Charset; Link Here
29
use C4::Log;
29
use C4::Log;
30
use Koha::MetadataRecord::Authority;
30
use Koha::MetadataRecord::Authority;
31
use Koha::Authorities;
31
use Koha::Authorities;
32
use Koha::Authority::MergeRequest;
32
use Koha::Authority::MergeRequests;
33
use Koha::Authority::Types;
33
use Koha::Authority::Types;
34
use Koha::Authority;
34
use Koha::Authority;
35
use Koha::Libraries;
35
use Koha::Libraries;
Lines 649-654 sub DelAuthority { Link Here
649
    my $authid = $params->{authid} || return;
649
    my $authid = $params->{authid} || return;
650
    my $skip_merge = $params->{skip_merge};
650
    my $skip_merge = $params->{skip_merge};
651
    my $dbh = C4::Context->dbh;
651
    my $dbh = C4::Context->dbh;
652
653
    # Remove older pending merge requests for $authid to itself. (See bug 22437)
654
    my $condition = { authid => $authid, authid_new => [undef, 0, $authid], done => 0 };
655
    Koha::Authority::MergeRequests->search($condition)->delete;
656
652
    merge({ mergefrom => $authid }) if !$skip_merge;
657
    merge({ mergefrom => $authid }) if !$skip_merge;
653
    $dbh->do( "DELETE FROM auth_header WHERE authid=?", undef, $authid );
658
    $dbh->do( "DELETE FROM auth_header WHERE authid=?", undef, $authid );
654
    logaction( "AUTHORITIES", "DELETE", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog");
659
    logaction( "AUTHORITIES", "DELETE", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog");
(-)a/authorities/merge.pl (-6 / +1 lines)
Lines 83-93 if ($merge) { Link Here
83
    my $MARCfrom = GetAuthority( $recordid2 );
83
    my $MARCfrom = GetAuthority( $recordid2 );
84
    merge({ mergefrom => $recordid2, MARCfrom => $MARCfrom, mergeto => $recordid1, MARCto => $record });
84
    merge({ mergefrom => $recordid2, MARCfrom => $MARCfrom, mergeto => $recordid1, MARCto => $record });
85
85
86
    # Delete the other record. Do not merge. It is unneeded and could under
86
    # Delete the other record. No need to merge.
87
    # special circumstances have unwanted side-effects.
88
    # Remove older pending merge requests for $recordid2 to itself. The above merge did the job already or will do. (See bug 22437)
89
    my $condition = { authid => $recordid2, authid_new => [undef, 0, $recordid2], done => 0 };
90
    Koha::Authority::MergeRequests->search($condition)->delete;
91
    DelAuthority({ authid => $recordid2, skip_merge => 1 });
87
    DelAuthority({ authid => $recordid2, skip_merge => 1 });
92
88
93
    # Parameters
89
    # Parameters
94
- 

Return to bug 22437