From ed0714051eaff723d05a2030d6ef8867ae708bca Mon Sep 17 00:00:00 2001
From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Tue, 11 Jan 2011 21:45:53 +0000
Subject: [PATCH] fix regression with org selector when specifying ?ol= and the
 org unit hiding setting is unset

git-svn-id: svn://svn.open-ils.org/ILS/trunk@19155 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 Open-ILS/web/opac/common/js/opac_utils.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Open-ILS/web/opac/common/js/opac_utils.js b/Open-ILS/web/opac/common/js/opac_utils.js
index 9c10e2ae8b..e585137080 100644
--- a/Open-ILS/web/opac/common/js/opac_utils.js
+++ b/Open-ILS/web/opac/common/js/opac_utils.js
@@ -854,7 +854,11 @@ function checkOrgHiding() {
     if ( findOrgDepth( context_org ) < depth ) {
         return false; // disable org hiding if Original Location doesn't make sense with setting depth (avoids disjointed org selectors)
     }
-    return { 'org' : findOrgUnit(context_org), 'depth' : depth };
+    if (depth) {
+        return { 'org' : findOrgUnit(context_org), 'depth' : depth };
+    } else {
+        return false;
+    }
 }
 
 var orgTreeSelector;
-- 
2.11.0