From 22d9ee7c41eff75538deeb34f858c27e23fe50b5 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 28 Jan 2013 13:40:12 -0500 Subject: [PATCH] Consistent response type from TPAC pref lib lookup In some contexts, the $user->home_ou field is fleshed with a real org unit object. Ensure that the response value from _get_pref_lib in the TPAC takes this into consideration when finding the ID of the user's home org unit. Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm index 15d67be9ef..1b21646229 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm @@ -392,7 +392,8 @@ sub _get_pref_lib { return OpenSRF::Utils::JSON->JSON2perl($lset->value) if $lset; # Otherwise return the user's home library - return $ctx->{user}->home_ou; + my $ou = $ctx->{user}->home_ou; + return ref($ou) ? $ou->id : $ou; } if ($ctx->{physical_loc}) { -- 2.11.0