https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44342 --- Comment #1 from babar junaid <babarjunaid1122@gmail.com> --- Created attachment 212809 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212809&action=edit Bug 44342: Mark the checked-out ILL request returned on check-in Bug 44342: Mark the checked-out ILL request returned on check-in With CirculateILL on, AddReturn looked up the request to mark returned with ->find({ biblio_id => ... }). biblio_id is not unique in illrequests, so with several requests on one record find() took whichever row came first, regardless of status: a completed request could be set back to RET while the checked-out one stayed CHK. The check-in now takes the CHK request on the record, else the newest request still open, and never changes a request that is already RET or COMP. Test plan: 1. Apply only the test file change and run prove t/db_dependent/Koha/ILL/Requests.t The new subtest "Checking in with several requests on one record" fails: the COMP request becomes RET and the CHK one stays CHK (and DBIx::Class warns "Query returned more than one row"). 2. Apply the whole patch and run it again: the subtest passes. (On a koha-testing-docker without PO files the file's "no warnings" test fails with "The PO directory has not been found", on main without this patch too.) 3. prove t/db_dependent/Circulation/Returns.t still passes. Sponsored-by: Koha Solutions -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.