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

(-)a/Koha/SearchEngine/Elasticsearch/Indexer.pm (-1 / +1 lines)
Lines 100-106 Arrayref of C<MARC::Record>s. Link Here
100
sub update_index {
100
sub update_index {
101
    my ($self, $record_ids, $records) = @_;
101
    my ($self, $record_ids, $records) = @_;
102
102
103
    my $index_record_ids;
103
    my $index_record_ids = [];
104
    unless ( $records && @$records ) {
104
    unless ( $records && @$records ) {
105
        for my $record_id ( sort { $a <=> $b } @$record_ids ) {
105
        for my $record_id ( sort { $a <=> $b } @$record_ids ) {
106
106
(-)a/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t (-2 / +17 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 3;
22
use Test::More tests => 4;
23
use Test::MockModule;
23
use Test::MockModule;
24
use Test::Warn;
24
use Test::Warn;
25
use t::lib::Mocks;
25
use t::lib::Mocks;
Lines 120-125 subtest 'index_records() tests' => sub { Link Here
120
    }
120
    }
121
    "Update background " . $biblio->biblionumber,
121
    "Update background " . $biblio->biblionumber,
122
    "When passing id only to index_records the marc record is fetched and passed through to update_index";
122
    "When passing id only to index_records the marc record is fetched and passed through to update_index";
123
124
};
125
126
subtest 'update_index' => sub {
127
    plan tests => 1;
128
129
    my $biblio = $builder->build_sample_biblio;
130
    my $biblionumber = $biblio->biblionumber;
131
    $biblio->delete;
132
133
    my $indexer = Koha::SearchEngine::Elasticsearch::Indexer->new({ 'index' => 'biblios' });
134
    warning_is {
135
        $indexer->update_index([$biblionumber]);
136
137
    } "", "update_index called with deleted biblionumber should not crash";
138
123
};
139
};
124
140
125
}
141
}
126
- 

Return to bug 27344