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

            Bug ID: 43879
           Summary: AddReturn does not reindex the record when a withdrawn
                    item blocks the return after clearing onloan
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: Circulation
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected], [email protected]
  Target Milestone: ---

In AddReturn, if the item is not checked out but has items.onloan set
(inconsistent data), onloan is cleared with skip_record_index, as the
record is reindexed at the end of the function.

But if the item is withdrawn and BlockReturnOfWithdrawnItems blocks the
return, AddReturn returns early, before reaching that reindex. The
database no longer has onloan, but the search index still has it, so
the search results keep showing the item as checked out.

With RecordLocalUseOnReturn enabled the record happens to be reindexed,
because the localuse store does not skip the indexing. Without it,
nothing is reindexed.

The Wrongbranch early return a few lines below already reindexes the
record before returning.

To reproduce:
1. Enable BlockReturnOfWithdrawnItems and disable RecordLocalUseOnReturn.
2. Take an item that is not checked out, set it as withdrawn and set
   items.onloan (e.g. UPDATE items SET onloan = CURDATE() WHERE
   itemnumber = X), and reindex its record.
3. Search the catalog: the item is shown as checked out.
4. Check the item in. The return is blocked (item withdrawn).
5. items.onloan is now NULL, but the search results still show the item
   as checked out.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
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