From 07bf16a7453fb850659c2b8f0b227db4c41675d6 Mon Sep 17 00:00:00 2001
From: Christopher <christopherreay@gmail.com>
Date: Tue, 7 Jun 2011 04:06:07 +0100
Subject: [PATCH] Fixed og_subgroups_hs not adding masked parents

In order to function, hs_subgroups must have a complete path to the added
from root to selected node in order for the validate function to work.
The original implementation did not add parent nodes that were masked
due to "private" status.
Now the nodes are added, with the title "<private>"

This is a poor implementation as there could be hundreds of private nodes
above a small number of accessible child nodes.
A new tree should be biult that only contains valid paths, with "root" nodes
being any top parent which is accessible
This is non trivial as there may be large gaps in branches of in accessible
nodes. The question is whether to include the gaps or not?
---
 includes/tree.inc                                  |    6 ++++--
 ...c_og_subgroups_get_tree.fixTooMuchCaching.patch |   17 +++++++++++++++++
 modules/og_subgroups_hs/og_subgroups_hs.module     |    6 ++++++
 3 files changed, 27 insertions(+), 2 deletions(-)
 create mode 100644 includes_tree.inc_og_subgroups_get_tree.fixTooMuchCaching.patch
diff --git a/modules/og_subgroups_hs/og_subgroups_hs.module b/modules/og_subgroups_hs/og_subgroups_hs.module
index 9df5dce..11a20a3 100644
--- a/modules/og_subgroups_hs/og_subgroups_hs.module
+++ b/modules/og_subgroups_hs/og_subgroups_hs.module
@@ -77,6 +77,9 @@ function og_subgroups_hs_hierarchical_select_root_level($params) {
         // Add the initial group as an option
         $root[$branch->nid] = $branch->title;
       }
+      else
+      { $root[$branch->nid] = "<private>";
+      }
     }
   }
   
@@ -117,6 +120,9 @@ function og_subgroups_hs_hierarchical_select_children($parent, $params) {
       if (!og_subgroups_mask_group($child, TRUE)) {
         $children[$child->nid] = $child->title;
       }
+      else
+      { $children[$child->nid] = "<private>";
+      }
     }
   }
 
-- 
1.7.1

