[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 21:06:42 CET 2021


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

--- Comment #11 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 117399
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=117399&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

Signed-off-by: Lisette Scheer <lisettes at latahlibrary.org>

Signed-off-by: Marti Fuerst <mfuerst at hmcpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>

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


More information about the Koha-bugs mailing list