Bug 26507: Elasticsearch - Index records after storing new item

Currently Item->store indexes the record before the DB update - that is wrong

To test:
 1 - Find/create a bib with no items
 2 - add an item with barcode "abc123"
 3 - do a general keyword search for "abc123," see your bib is not in the results
 4 - perform a search that includes your bib in the results, confirm it shows as having no items
 5 - click through to bib details, confirm it shows your item here
 6 - edit and save your item
 7 - confirm barcode is now searchable
 8 - apply patches
 9 - Add a new item "cde456"
10 - Confirm it returns in searches
11 - Edit 'cde456' and change barcode to 'fgh789'
12 - Confirm the new abrcode is searchable

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2020-09-22 14:14:55 +00:00 committed by Jonathan Druart
parent ffc156f84e
commit af9938c43f
1 changed files with 2 additions and 6 deletions

View File

@ -113,9 +113,6 @@ sub store {
$self->cn_sort($cn_sort);
}
C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" )
unless $params->{skip_modzebra_update};
logaction( "CATALOGUING", "ADD", $self->itemnumber, "item" )
if $log_action && C4::Context->preference("CataloguingLog");
@ -189,9 +186,6 @@ sub store {
$self->paidfor('');
}
C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" )
unless $params->{skip_modzebra_update};
logaction( "CATALOGUING", "MODIFY", $self->itemnumber, "item " . Dumper($self->unblessed) )
if $log_action && C4::Context->preference("CataloguingLog");
}
@ -201,6 +195,8 @@ sub store {
}
my $result = $self->SUPER::store;
C4::Biblio::ModZebra( $self->biblionumber, "specialUpdate", "biblioserver" )
unless $params->{skip_modzebra_update};
$self->get_from_storage->_after_item_action_hooks({ action => $plugin_action });
return $result;