Bug 33309: Index items after renewal transaction completes
authorNick Clemens <nick@bywatersolutions.com>
Wed, 22 Mar 2023 19:12:01 +0000 (19:12 +0000)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Wed, 3 May 2023 18:37:34 +0000 (20:37 +0200)
commit4a2ef7f1b33d8c1682b12c63611688bbabb628e0
tree7f9793c70a5c6486366471782a4b6ba9e327d39d
parentbff83318fb0e614e519892e771db3b9bfdf2935e
Bug 33309: Index items after renewal transaction completes

This patch ensures a record is indexed only after the renewal transaction
has completed successfully. Otherwise the job cannot be found by the background process
worker, becaue it was not yet in the DB

To test:
1 - Make sure you are using ES, and the es indexer is running
2 - tail -f /var/log/koha/kohadev/*.log
3 - Issue an item to a patron and renew it
4 - Note error in es-indexer-output.log like:
    [2023/03/21 12:22:36] [WARN] No job found for id=157 main:: /kohadevbox/koha/misc/workers/es_indexer_daemon.pl (129)
5 - Apply patch
6 - Renew again
7  There should be no error
8 - Search for the record and confirm items info displays correctly
9 - View the background jobs in admin, confirm the most recent job has completed

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a63b0d00306d639241a400cecbe3b0125ee8d303)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
(cherry picked from commit ff03813f9fcf79e32dd95a1f4913ba64392a1610)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0081194b40d1c5ab081e85539864a8513cccd311)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
C4/Circulation.pm
Koha/Item.pm