Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
og
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
og
Commits
990bf49a
Commit
990bf49a
authored
Jun 23, 2017
by
Jorrit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize some calls to og_is_group()
og_is_group() is faster when an entire entity is provided.
parent
b884b910
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
og_context/og_context.module
og_context/og_context.module
+1
-1
og_ui/og_ui.module
og_ui/og_ui.module
+1
-1
No files found.
og_context/og_context.module
View file @
990bf49a
...
...
@@ -640,7 +640,7 @@ function _group_context_handler_entity($entity_type = 'node', $entity = NULL, $p
}
// 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
;
}
elseif
(
$gids
=
og_get_entity_groups
(
$entity_type
,
$entity
))
{
...
...
og_ui/og_ui.module
View file @
990bf49a
...
...
@@ -333,7 +333,7 @@ function og_ui_user_access_group($perm, $group_type, $gid) {
// Not a valid entity type.
return
FALSE
;
}
return
og_is_group
(
$group_type
,
$g
id
)
&&
og_user_access
(
$group_type
,
$gid
,
$perm
);
return
og_is_group
(
$group_type
,
$g
roup
)
&&
og_user_access
(
$group_type
,
$gid
,
$perm
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment