Bug 31437 - ModItemTransfer triggers indexing twice
Summary: ModItemTransfer triggers indexing twice
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords: rel_22_11_candidate
Depends on: 30718 24446
Blocks:
  Show dependency treegraph
 
Reported: 2022-08-22 14:25 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2023-12-28 20:43 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Circulation function:


Attachments
Revert "Bug 30718: (follow-up) index_records is called more times than we thought" (1.69 KB, patch)
2022-10-14 09:07 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 31437: (bug 30718 follow-up) Prevent useless indexation call from ModDateLastSeen (1.12 KB, patch)
2022-10-14 09:07 UTC, Jonathan Druart
Details | Diff | Splinter Review
Revert "Bug 30718: (follow-up) index_records is called more times than we thought" (1.75 KB, patch)
2022-10-14 12:23 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 31437: (bug 30718 follow-up) Prevent useless indexation call from ModDateLastSeen (1.18 KB, patch)
2022-10-14 12:23 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2022-08-22 14:25:34 UTC
After 30718 ModItemTransfer leads to two calls on index_records. I bisected it down to 48bf9b1d91dbbc336f859ac1a83d7d25b0e6a3c1 but couldn't figure how that change is relevant. My gut feeling is that we were somehow hidding an error and the change to DateTime 'fixed' it. The code clearly yields to two calls to index_records as ->transit calls ModDateLastSeen without passing the skip_record_index flag.

I added a follow-up on bug 30718 to fix the tests and expect we make a decision here.

This bug could be replaced by bug 25754 as this needs a final refactoring removing it IMHO.
Comment 1 Jonathan Druart 2022-10-14 09:07:31 UTC
Created attachment 141866 [details] [review]
Revert "Bug 30718: (follow-up) index_records is called more times than we thought"

This reverts commit 35165e5f13ec11a62dea7f6b129f7f07c7ecb7f4.
Comment 2 Jonathan Druart 2022-10-14 09:07:35 UTC
Created attachment 141867 [details] [review]
Bug 31437: (bug 30718 follow-up) Prevent useless indexation call from ModDateLastSeen

Koha::Object->store is triggering an UPDATE because the datelastseen is
different than the value in DB (comparing a datetime with a date)
Comment 3 Tomás Cohen Arazi (tcohen) 2022-10-14 12:23:30 UTC
Created attachment 141874 [details] [review]
Revert "Bug 30718: (follow-up) index_records is called more times than we thought"

This reverts commit 35165e5f13ec11a62dea7f6b129f7f07c7ecb7f4.

https://bugs.koha-community.org/show_bug.cgi?id=31437
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi (tcohen) 2022-10-14 12:23:35 UTC
Created attachment 141875 [details] [review]
Bug 31437: (bug 30718 follow-up) Prevent useless indexation call from ModDateLastSeen

Koha::Object->store is triggering an UPDATE because the datelastseen is
different than the value in DB (comparing a datetime with a date)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Tomás Cohen Arazi (tcohen) 2022-10-14 12:33:41 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!