https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383 --- Comment #58 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 209609 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209609&action=edit Bug 42383: (QA follow-up) Use the returning patron for check-in notices This patch makes AddReturn pass the patron the item was checked out to down to _attach_messages_to_checkin, which uses it for the patron_has_fines (FineNotifyAtCheckin) and patron_has_waiting_holds (WaitingNotifyAtCheckin) messages. Before, those messages were built from $checkin->checkout->patron. The checkin's checkout is the old_issues row, which MarkIssueReturned has already anonymised for patrons with privacy set to 'Never' (when AnonymousPatron is set). The messages were then computed for, and pointed to, the anonymous patron instead of the patron who returned the item. It addresses point 11 of the QA comment. Test plan: 1. Set AnonymousPatron to an existing patron, and enable FineNotifyAtCheckin and WaitingNotifyAtCheckin 2. Pick a patron with no fines, set their privacy to 'Never'. Give them a manual fee and a waiting hold at your library 3. Check out an item to them, then check it in on the check-in page => FAIL: No fines or waiting holds message is displayed 4. Apply this patch and restart plack: $ ktd --shell k$ koha-plack --restart kohadev 5. Repeat 3 => SUCCESS: The fines and waiting holds messages are displayed and link to the right patron 6. Run: k$ prove t/db_dependent/Circulation.t => SUCCESS: Tests pass! 7. Sign off :-D Assisted-by: Opus 5.5 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.