Add New Patron Fails with Wrong Error Message if DB Update Fails

Bug #1698176 reported by Jason Stephenson on 2017-06-15
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Evergreen Version 2.12.1
OpenSRF Version 2.5.0
PostgreSQL Version: 9.3+ N/A

If the database insert statement fails while adding a new user, the cstore editor die_event is returned improperly in the _add_patron helper function of OpenILS::Application::Actor. The caller expects a 2-member array with the first being the user object and the second being the event. In the case of the database failure, only the event is returned a scalar value.

Rather than dying with the event message, the caller treats the event as the user object which leads to a later failure with the message: Can't call method "billing_address" on unblessed reference at /path/to/perlib/OpenILS/Application/ line 743.

For some more information, see the IRC conversation between Freddy_Enrique and Dyrcona beginning here:

Jason Stephenson (jstephenson) wrote :

I forgot to link the branch, so here it is, rebased on master:


tags: added: pullrequest
Cesar V (cesardv) wrote :

This should do the trick Jason, thanks. I couldn't quite pin point the missing patron field, but it's definitely a bug to not to return an array of undef and the exception. There might some other similar instances where the client might not check for an exception and try to do the same thing but since the XUL client is deprecated, this will suffice.

Signoff branch here:;a=shortlog;h=refs/heads/user/cesardv/dyrcona_lp1698176_add_patron_die_event_fix-signoff

tags: added: signedoff
Changed in evergreen:
milestone: none → 3.1-beta
Jason Stephenson (jstephenson) wrote :

Pushed to master, rel_3_0, and rel_2_12. Thanks for signing off, Cesar!

Changed in evergreen:
status: New → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers