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

--- Comment #2 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 201230
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201230&action=edit
Bug 39215: Skip and report EDIFACT quote lines that cannot be processed

When loading an EDIFACT quote, problematic data on a single order line
(most commonly a mismatched branchcode in the LLO GIR field, or any other
enumerated/coded value that breaches a database constraint) caused the
whole process_quote run to die. The message was left stuck displaying as
'Processing' on the EDIFACT messages page and the remaining, valid quotes
in the file were never imported.

This patch makes quote processing resilient:

- Each order line is processed inside a try/catch in process_quote, so an
  unexpected failure is reported and skipped rather than aborting the file.
  The message always resolves to 'received' or 'error', never 'processing'.

- Item creation (Koha::Item->store) is wrapped in try/catch at each of the
  three creation sites. A failing item is reported through the EDIFACT
  error infrastructure and skipped, while sibling items and other order
  lines continue to be processed.

- AddBiblio traps its own exceptions, warns them and returns an undef
  biblionumber. We now capture that warning, surface the underlying cause
  in the EDIFACT error report and skip the line, rather than carrying on to
  create an orphan order line against a non-existent biblio.

- Database exceptions are translated into a concise, end-user friendly
  message (e.g. the offending field name) so library staff can identify
  the problem data.

- A basket that contained any unprocessable line is no longer auto-ordered;
  it is left open with a logged explanation so staff can review and correct
  the affected lines before ordering manually.

A FIXME notes that wrapping the order + item creation in a transaction (to
roll a failed line back cleanly) is left to bug 41087 (EDI Retry).

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to