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