From 415a3e98ab658f87f7ac72f62eb203cf17ec7583 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 Signed-off-by: Ben Shum --- 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 39f986fdc7..93cc3e120d 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