From 5795776653b0db0aa8d7c43fef9e0ce1ab03b5a9 Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 21 Jul 2010 20:06:56 +0000 Subject: [PATCH] protect acn, acp and auri from our $lib faking git-svn-id: svn://svn.open-ils.org/ILS/trunk@17002 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm index c9ce84024..a9eaa90e8 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm @@ -482,13 +482,16 @@ sub unapi { )->gather(1)->[0]->shortname; } - my $lib_object = $actor->request( - 'open-ils.actor.org_unit_list.search' => shortname => $lib - )->gather(1)->[0]; - my $lib_id = $lib_object->id; - - my $ou_types = $actor->request( 'open-ils.actor.org_types.retrieve' )->gather(1); - my $lib_depth = $depth || (grep { $_->id == $lib_object->ou_type } @$ou_types)[0]->depth; + my ($lib_object,$lib_id,$ou_types,$lib_depth); + if ($type ne 'acn' && $type ne 'acp' && $type ne 'auri') { + $lib_object = $actor->request( + 'open-ils.actor.org_unit_list.search' => shortname => $lib + )->gather(1)->[0]; + $lib_id = $lib_object->id; + + $ou_types = $actor->request( 'open-ils.actor.org_types.retrieve' )->gather(1); + $lib_depth = $depth || (grep { $_->id == $lib_object->ou_type } @$ou_types)[0]->depth; + } if ($command eq 'browse') { print "Location: $root/browse/$base_format/$scheme/$lib/$id\n\n"; -- 2.11.0