|
Lines 675-686
Deletes $authid and calls merge to cleanup linked biblio records.
Link Here
|
| 675 |
Parameter skip_merge is used in authorities/merge.pl. You should normally not |
675 |
Parameter skip_merge is used in authorities/merge.pl. You should normally not |
| 676 |
use it. |
676 |
use it. |
| 677 |
|
677 |
|
|
|
678 |
skip_record_index will skip the indexation step. |
| 679 |
|
| 678 |
=cut |
680 |
=cut |
| 679 |
|
681 |
|
| 680 |
sub DelAuthority { |
682 |
sub DelAuthority { |
| 681 |
my ( $params ) = @_; |
683 |
my ( $params ) = @_; |
| 682 |
my $authid = $params->{authid} || return; |
684 |
my $authid = $params->{authid} || return; |
| 683 |
my $skip_merge = $params->{skip_merge}; |
685 |
my $skip_merge = $params->{skip_merge}; |
|
|
686 |
my $skip_record_index = $params->{skip_record_index} || 0; |
| 687 |
|
| 684 |
my $dbh = C4::Context->dbh; |
688 |
my $dbh = C4::Context->dbh; |
| 685 |
|
689 |
|
| 686 |
# Remove older pending merge requests for $authid to itself. (See bug 22437) |
690 |
# Remove older pending merge requests for $authid to itself. (See bug 22437) |
|
Lines 690-697
sub DelAuthority {
Link Here
|
| 690 |
merge({ mergefrom => $authid }) if !$skip_merge; |
694 |
merge({ mergefrom => $authid }) if !$skip_merge; |
| 691 |
$dbh->do( "DELETE FROM auth_header WHERE authid=?", undef, $authid ); |
695 |
$dbh->do( "DELETE FROM auth_header WHERE authid=?", undef, $authid ); |
| 692 |
logaction( "AUTHORITIES", "DELETE", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog"); |
696 |
logaction( "AUTHORITIES", "DELETE", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog"); |
| 693 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::AUTHORITIES_INDEX }); |
697 |
unless ( $skip_record_index ) { |
| 694 |
$indexer->index_records( $authid, "recordDelete", "authorityserver", undef ); |
698 |
my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::AUTHORITIES_INDEX }); |
|
|
699 |
$indexer->index_records( $authid, "recordDelete", "authorityserver", undef ); |
| 700 |
} |
| 695 |
|
701 |
|
| 696 |
_after_authority_action_hooks({ action => 'delete', authority_id => $authid }); |
702 |
_after_authority_action_hooks({ action => 'delete', authority_id => $authid }); |
| 697 |
} |
703 |
} |