From 6f6e81e885a146c0a1d74d4fdafbba044bbca31b Mon Sep 17 00:00:00 2001
From: miker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Fri, 18 Jun 2010 16:55:57 +0000
Subject: [PATCH] make sure $depth is defined, and used

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16761 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
index a608f57486..4df2b68bc2 100644
--- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
+++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
@@ -359,7 +359,7 @@ sub unapi {
 	my $format = $cgi->param('format');
 	my $flesh_feed = parse_feed_type($format);
 	(my $base_format = $format) =~ s/(-full|-uris)$//o;
-	my ($id,$type,$command,$lib,$paging) = ('','','');
+	my ($id,$type,$command,$lib,$depth,$paging) = ('','','');
 
 	if (!$format) {
 		my $body = "Content-type: application/xml; charset=utf-8\n\n";
@@ -487,7 +487,7 @@ sub unapi {
 	my $lib_id = $lib_object->id;
 
 	my $ou_types = $actor->request( 'open-ils.actor.org_types.retrieve' )->gather(1);
-	my $lib_depth = (grep { $_->id == $lib_object->ou_type } @$ou_types)[0]->depth;
+	my $lib_depth = $depth || (grep { $_->id == $lib_object->ou_type } @$ou_types)[0]->depth;
 
 	if ($type eq 'call_number' and $command eq 'browse') {
 		print "Location: $root/browse/$base_format/call_number/$lib/$id\n\n";
-- 
2.11.0