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"); |