[open-ils-commits] r13557 - trunk/Open-ILS/src/perlmods/OpenILS/Application (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jul 9 16:10:20 EDT 2009


Author: erickson
Date: 2009-07-09 16:10:16 -0400 (Thu, 09 Jul 2009)
New Revision: 13557

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Log:
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

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm	2009-07-09 18:45:54 UTC (rev 13556)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm	2009-07-09 20:10:16 UTC (rev 13557)
@@ -1308,24 +1308,22 @@
 
 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.



More information about the open-ils-commits mailing list