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

(-)a/C4/Circulation.pm (-11 / +2 lines)
Lines 3815-3835 sub ReturnLostItem{ Link Here
3815
3815
3816
=head2 LostItem
3816
=head2 LostItem
3817
3817
3818
  LostItem( $itemnumber, $mark_lost_from, $force_mark_returned, [$params] );
3818
  LostItem( $itemnumber, $mark_lost_from, $force_mark_returned );
3819
3820
The final optional parameter, C<$params>, expected to contain
3821
'skip_record_index' key, which relayed down to Koha::Item/store,
3822
there it prevents calling of ModZebra index_records,
3823
which takes most of the time in batch adds/deletes: index_records better
3824
to be called later in C<additem.pl> after the whole loop.
3825
3826
$params:
3827
    skip_record_index => 1|0
3828
3819
3829
=cut
3820
=cut
3830
3821
3831
sub LostItem{
3822
sub LostItem{
3832
    my ($itemnumber, $mark_lost_from, $force_mark_returned, $params) = @_;
3823
    my ($itemnumber, $mark_lost_from, $force_mark_returned) = @_;
3833
3824
3834
    unless ( $mark_lost_from ) {
3825
    unless ( $mark_lost_from ) {
3835
        # Temporary check to avoid regressions
3826
        # Temporary check to avoid regressions
(-)a/t/db_dependent/Koha/SearchEngine/Indexer.t (-30 lines)
Lines 159-193 subtest 'Test indexer calls' => sub { Link Here
159
            AddReturn($item->barcode, $item->homebranch, 0, undef);
159
            AddReturn($item->barcode, $item->homebranch, 0, undef);
160
        } [$engine,'C4::Circulation'], "index_records is called once for $engine when calling AddReturn if item not issued";
160
        } [$engine,'C4::Circulation'], "index_records is called once for $engine when calling AddReturn if item not issued";
161
161
162
        $builder->build(
163
            {
164
                source => 'Branchtransfer',
165
                value  => {
166
                    itemnumber    => $item->itemnumber,
167
                    datesent      => dt_from_string,
168
                    datearrived   => undef,
169
                    datecancelled => undef
170
                }
171
            }
172
        );
173
        warnings_are{
174
            LostItem( $item->itemnumber, "tests");
175
        } [$engine,"Koha::Item"], "index_records is called for $engine when calling LostItem and transfer exists";
176
        $builder->build(
177
            {
178
                source => 'Branchtransfer',
179
                value  => {
180
                    itemnumber    => $item2->itemnumber,
181
                    datesent      => dt_from_string,
182
                    datearrived   => undef,
183
                    datecancelled => undef
184
                }
185
            }
186
        );
187
        warnings_are{
188
            LostItem( $item->itemnumber, "tests", undef, { skip_record_index => 1 });
189
        } undef, "index_records is not called for $engine when calling LostItem and transfer exists if skip_record_index";
190
191
        $item->datelastseen('2020-02-02');
162
        $item->datelastseen('2020-02-02');
192
        $item->store({skip_record_index=>1});
163
        $item->store({skip_record_index=>1});
193
        warnings_are{
164
        warnings_are{
194
- 

Return to bug 27281