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

Bug #1698176 reported by Jason Stephenson on 2017-06-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Undecided
Unassigned
2.12
Undecided
Unassigned
3.0
Undecided
Unassigned

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/Actor.pm line 743.

For some more information, see the IRC conversation between Freddy_Enrique and Dyrcona beginning here: http://irc.evergreen-ils.org/evergreen/2017-06-15#i_310553

Jason Stephenson (jstephenson) wrote :

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

working/user/dyrcona/lp1698176_add_patron_die_event_fix

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dyrcona/lp1698176_add_patron_die_event_fix

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: http://git.evergreen-ils.org/?p=working/Evergreen.git;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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers