[Koha-bugs] [Bug 27808] Item's onloan column remains unset if a checked out item is issued to another patron without being returned first

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Feb 26 16:03:13 CET 2021


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

Kyle M Hall <kyle at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #117381|0                           |1
        is obsolete|                            |

--- Comment #3 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 117382
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117382&action=edit
Bug 27808: Mark the onloan column as dirty in AddIssue

If any item is currently checked out to a patron, and the item is then checked
out directly to another patron without manually checking the item in first, the
items.onloan column will remain NULL.

This will only happen if the new checkout will be due the same day as the
previous checked.

This is caused by the item being returned without updating the item object from
storage afterward. Even though AddIssue will call AddReturn which sets the
value of onloan to NULL in the database, we are not passing in the item object
by reference, so it's onloan value remains set to a date. Then we set the
onloan value to the same date. Because the value does not change in the object,
the column does not get marked dirty.

We could update the object from storage first, but it seems more efficient to
mark the column as dirty manually to avoid that otherwise unnecessary fetch.

Test Plan:
1) Apply these patches
2) prove t/db_dependent/Circulation.t

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list