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

--- Comment #104 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 208547
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208547&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 <[email protected]>
Signed-off-by: Tomás Cohen Arazi <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to