[Bug 44342] New: With CirculateILL, checking in an item can mark the wrong ILL request returned, or reopen a completed one
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44342 Bug ID: 44342 Summary: With CirculateILL, checking in an item can mark the wrong ILL request returned, or reopen a completed one Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: ILL Assignee: koha-bugs@lists.koha-community.org Reporter: babarjunaid1122@gmail.com QA Contact: testopia@bugs.koha-community.org CC: lisette@bywatersolutions.com, pedro.amorim@openfifth.co.uk, tomascohen@gmail.com Target Milestone: --- With CirculateILL on, AddReturn finds the ILL request to mark returned with Koha::ILL::Requests->find( { biblio_id => $item->biblio->biblionumber } ); biblio_id is not unique in illrequests (a record can be linked to several requests: a repeat request for the same title, a request made against an existing record). find() on a non-unique column takes whichever row the database returns first (and DBIx::Class warns "Query returned more than one row"). The status of the request is not looked at either. So when a record has a completed request and the current, checked-out one, checking the item in can set the old COMP request back to RET and leave the real one at CHK. To reproduce (main 186bbe7): see the new subtest "Checking in with several requests on one record" in t/db_dependent/Koha/ILL/Requests.t: 1. One record with three ILL requests: COMP (oldest), REQ, CHK. 2. Check an item of that record out and back in. 3. Without the fix the COMP request becomes RET and the CHK request stays CHK, and the DBIx::Class warning is printed. Expected: the checked-out (CHK) request is marked RET; if there is none, the newest request still open; a request already RET or COMP is never changed. (The test file's "no warnings" test also fails on a koha-testing-docker without the PO files, "The PO directory has not been found"; that happens on main without this patch too.) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44342 babar junaid <babarjunaid1122@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |babarjunaid1122@gmail.com |ity.org | Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org