[Bug 43789] New: EDI quote processing dies with undefined to_json when AcquisitionLog is enabled
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43789 Bug ID: 43789 Summary: EDI quote processing dies with undefined to_json when AcquisitionLog is enabled Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Koha::EDI::process_quote logs the automatic basket approval with to_json( $approved->unblessed ), but Koha::EDI only imports encode_json from JSON: use JSON qw( encode_json ); so when a vendor has auto_orders enabled and the AcquisitionLog system preference is on, edi_cron.pl fails after the order has been generated and the basket closed: Undefined subroutine &Koha::EDI::to_json called at Koha/EDI.pm line NNN. The APPROVE_BASKET entry is never written to the action log and processing of any remaining auto-ordered baskets in the same run is aborted. Test plan: 1. Enable the EDIFACT and AcquisitionLog system preferences. 2. Configure a vendor EDI account with quotes_enabled and auto_orders enabled. 3. Process a quote for that vendor (misc/cronjobs/edi_cron.pl, or process_quote in a test). 4. Without the patch: Undefined subroutine &Koha::EDI::to_json is raised. 5. Apply the patch and repeat: no error, the basket is closed, the EDI order is created and an ACQUISITIONS / APPROVE_BASKET entry exists in the action logs. 6. prove t/db_dependent/Koha/EDI.t -- 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=43789 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 207815 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207815&action=edit Bug 43789: Import to_json in Koha::EDI process_quote logs the automatic basket approval with to_json(), but only encode_json was imported from JSON. With auto_orders enabled and AcquisitionLog on, edi_cron.pl died with "Undefined subroutine &Koha::EDI::to_json" after the order had been created and the basket closed, so the APPROVE_BASKET log entry was never written. Import to_json and add a test that processes an auto-order quote with AcquisitionLog enabled and checks the log entry. Test plan: 1. prove t/db_dependent/Koha/EDI.t => the new auto_orders_acquisition_log subtest fails without the patch => all tests pass with it Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- 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=43789 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | -- 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=43789 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43789 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #207815|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43789 --- Comment #2 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 207959 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207959&action=edit Bug 43789: Import to_json in Koha::EDI process_quote logs the automatic basket approval with to_json(), but only encode_json was imported from JSON. With auto_orders enabled and AcquisitionLog on, edi_cron.pl died with "Undefined subroutine &Koha::EDI::to_json" after the order had been created and the basket closed, so the APPROVE_BASKET log entry was never written. Import to_json and add a test that processes an auto-order quote with AcquisitionLog enabled and checks the log entry. Test plan: 1. prove t/db_dependent/Koha/EDI.t => the new auto_orders_acquisition_log subtest fails without the patch => all tests pass with it Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43789 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |41852 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41852 [Bug 41852] Modernize EDI support in Koha -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org