https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42418 --- Comment #82 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 204913 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204913&action=edit Bug 42418: (QA follow-up) Fix DataCorrupted return arity and checkin timestamp population Two fixes to how AddReturn manages the Koha::Checkin audit record it creates for every scan: - The checkin record's DB-computed defaults (e.g. timestamp, which defaults to current_timestamp()) were never refreshed from storage after the initial INSERT, so the in-memory object kept holding the literal SQL placeholder DBIx::Class leaves behind instead of the real value. Add ->discard_changes after ->store to fix this. - AddReturn's DataCorrupted error path (fired when MarkIssueReturned dies) still returned the pre-Bug-42418 4-tuple instead of including $checkin_record, and never attached its own messages to it. This crashed the REST controller's to_api($checkin) call on undef, masking the real error behind a generic 500 and leaving the audit row without any explanation of what happened. Add a 'data_corrupted' message case to _attach_messages_to_checkin for this. Test plan: 1. prove t/db_dependent/Circulation.t t/db_dependent/Koha/Checkin.t => SUCCESS: all pass. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.