EDI order pusher fails if ordering agency has no mailing address

Bug #2016188 reported by Jeff Davis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Committed
Undecided
Unassigned

Bug Description

EG 3.9.1

I was trying to run edi_order_pusher.pl in test mode for a specific purchase order, and it failed with this error message:

Can't call method "san" on an undefined value at /usr/local/share/perl/5.30.0/OpenILS/Utils/EDIWriter.pm line 151.

I believe the reason for the error was this line in the EDIWriter.pm compile_po subroutine:

org_unit_san => $po->ordering_agency->mailing_address->san || '',

If your ordering agency doesn't have a mailing address (it's not a required field), this will give an error.

Fix forthcoming.

Changed in evergreen:
assignee: nobody → Jeff Davis (jdavis-sitka)
Revision history for this message
Jeff Davis (jdavis-sitka) wrote (last edit ):

Working branch user/jeffdavis/lp2016188-edi-order-pusher-mailing-address has an inelegant but hopefully effective fix:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/jeffdavis/lp2016188-edi-order-pusher-mailing-address

To test:

1. Create a PO where the ordering agency is an org unit with no mailing address.
2. Generate EDI output for the PO: perl /openils/bin/edi_order_pusher.pl --test-mode --po-id $PO_ID

Expected behavior: EDI is printed to stdout.
Actual behavior: You get an error message: Can't call method "san" on an undefined value.

After applying the fix, try step 2 again, and it should give you the expected EDI output.

Changed in evergreen:
assignee: Jeff Davis (jdavis-sitka) → nobody
tags: added: acq acq-edi pullrequest
Revision history for this message
Blake GH (bmagic) wrote :

This problem might have been addressed via bug 1930753. Though, a slightly different solution. It seems to me that this patch is stronger?

Revision history for this message
Chris Sharp (chrissharp123) wrote :

From my analysis, bug 1930753 is different, and Jeff's patch can be considered separately. I will test both.

Changed in evergreen:
assignee: nobody → Chris Sharp (chrissharp123)
Revision history for this message
Chris Sharp (chrissharp123) wrote :

Works for me! Pushed to main, 3_9 and 3_10. Thanks, Jeff!

Changed in evergreen:
status: New → Fix Committed
assignee: Chris Sharp (chrissharp123) → nobody
tags: added: signedoff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.