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