From 2629f4b2d19ec847678726c704a07a83c60b0635 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 9 Jul 2009 20:10:16 +0000 Subject: [PATCH] don't force a depth on the call to actor.org_unit_full_path. if no depth is requested, call the no-depth version of the function git-svn-id: svn://svn.open-ils.org/ILS/trunk@13557 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm index 6b68e51f8d..c20c18eebf 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm @@ -1308,24 +1308,22 @@ sub get_org_ancestors { sub get_org_full_path { my($self, $org_id, $depth) = @_; - $depth ||= 0; - my $org_list = OpenILS::Utils::CStoreEditor->new->json_query({ - select => { + my $query = { + select => { aou => [{ transform => 'actor.org_unit_full_path', column => 'id', result_field => 'id', - params => [$depth] }], }, from => 'aou', where => {id => $org_id} - }); + }; - my @orgs; - push(@orgs, $_->{id}) for @$org_list; - return \@orgs; + $query->{select}->{aou}->[0]->{params} = [$depth] if defined $depth; + my $org_list = OpenILS::Utils::CStoreEditor->new->json_query($query); + return [ map {$_->{id}} @$org_list ]; } # returns the user's configured locale as a string. Defaults to en-US if none is configured. -- 2.11.0