https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43905

--- Comment #2 from Adolfo Rodríguez Taboada <[email protected]> ---
Created attachment 208974
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208974&action=edit
Bug 43905: Reindex the record of the items replaced by a staged MARC import

When a staged MARC import replaces an item (item action "replace"), the
item stays attached to its record, which can be a different one than
the imported record. BatchCommitRecords only reindexed the imported
records, so the search results kept showing the old data of the
replaced item.

This patch makes _batchCommitItems also return the records of the
replaced items that are attached to another record, and
BatchCommitRecords adds them to the records to reindex and to the holds
queue update, without duplicates.

Steps to follow:
1. Make sure the search index is updated automatically (koha-es-indexer
   running, or the Zebra daemon) and that the background jobs worker is
   running.
2. Choose an item of a record A, note its barcode and call number, and
   choose another record B with an ISBN.
3. Create a MARC file with a record that has the ISBN of record B in
   020$a, and a 952 with the barcode of the item of record A and a new
   call number in 952$o (and 952$a, $b and $y).
4. Cataloging > Stage records for import: stage the file with:
   - Record matching rule: ISBN
   - Action if matching record found: Ignore incoming record
   - Action if no match is found: Ignore incoming record
   - How to process items: Replace items if matching bib was found
   and import the batch (Cataloging > Manage staged records > Import
   this batch into the catalog): 1 item is replaced.
5. The item has the new call number in the database (record A, Edit
   items), but the search results still show the old one for record A.
6. Restore the call number of the item, apply the patch, restart_all
   (or restart Plack and the background jobs worker) and repeat steps
   4 and 5: now the search results show the new call number for
   record A.
7. prove t/db_dependent/ImportBatch.t

Signed-off-by: Adolfo Rodríguez <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to