Unverified Commit d16275a0 authored by amitaibu's avatar amitaibu Committed by GitHub

Merge pull request #281 from jorrit/og_is_group

Optimize some calls to og_is_group()
parents b884b910 990bf49a
...@@ -640,7 +640,7 @@ function _group_context_handler_entity($entity_type = 'node', $entity = NULL, $p ...@@ -640,7 +640,7 @@ function _group_context_handler_entity($entity_type = 'node', $entity = NULL, $p
} }
// Check if the entity is itself a group. // Check if the entity is itself a group.
if ($group = og_is_group($entity_type, $id)) { if (og_is_group($entity_type, $entity)) {
$contexts[$entity_type][] = $id; $contexts[$entity_type][] = $id;
} }
elseif ($gids = og_get_entity_groups($entity_type, $entity)) { elseif ($gids = og_get_entity_groups($entity_type, $entity)) {
......
...@@ -333,7 +333,7 @@ function og_ui_user_access_group($perm, $group_type, $gid) { ...@@ -333,7 +333,7 @@ function og_ui_user_access_group($perm, $group_type, $gid) {
// Not a valid entity type. // Not a valid entity type.
return FALSE; return FALSE;
} }
return og_is_group($group_type, $gid) && og_user_access($group_type, $gid, $perm); return og_is_group($group_type, $group) && og_user_access($group_type, $gid, $perm);
} }
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment