diff --git a/og_context/og_context.module b/og_context/og_context.module index 6348e6f..79e6d37 100644 --- a/og_context/og_context.module +++ b/og_context/og_context.module @@ -194,10 +194,14 @@ function og_context($group_type = 'node', $group = NULL) { global $user; $context = &drupal_static(__FUNCTION__, FALSE); - if (empty($group) && !empty($context) && $context['group_type'] == $group_type) { + if (empty($group) && $context !== FALSE && (empty($context)) || $context['group_type'] == $group_type) { return $context; } + // Set the context to array, so we can now this function has been already + // executed. + $context = array(); + if (!empty($group)) { // Set the group. list($id) = entity_extract_ids($group_type, $group);