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

Bug #1698176 reported by Jason Stephenson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned
2.12
Fix Released
Undecided
Unassigned
3.0
Fix Released
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

Revision history for this message
Jason Stephenson (jstephenson) wrote :
Revision history for this message
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
Revision history for this message
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
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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