don't force a depth on the call to actor.org_unit_full_path. if no depth is requeste...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Jul 2009 20:10:16 +0000 (20:10 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Jul 2009 20:10:16 +0000 (20:10 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13557 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm

index 6b68e51..c20c18e 100644 (file)
@@ -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.