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 <berick@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
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}) {