Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Change #5008

Category None
Changed by Jason Stephenson <jasonohnoyoudont@sigio.com>
Changed at Mon 20 Nov 2017 12:27:56
Repository git://git.evergreen-ils.org/Evergreen.git
Project Evergreen
Branch master
Revision e99692f809f698c451b8feba6332fa91eacd4fcd

Comments

LP 1698176: Return undef with die event in Actor.pm _add_patron function.
If the CStoreEditor create_actor_user call fails in the _add_patron
helper function in OpenILS/Application/Actor.pm, the CStorEditor's
die_event is returned as a scalar value.  The caller expects a list
return with two values: the user object in index 0 and the event, if
any, in index 1.

Returning just the event causes the caller to use the event as if it
were the user object.  This leads to a different error message later
in the code: Can't call method "billing_address" on unblessed
reference at /path/to/perlib/OpenILS/Application/Actor.pm line 743.

This commit changes the return value in the event of a database insert
failure to be the two member list as expected by the caller with undef
in index 0 and the die_event in index 1.  This returns the proper
error message to the client.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>

Changed files