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
28c2d66e
Commit
28c2d66e
authored
Feb 13, 2018
by
jacob.embree
Committed by
jacob.embree
Feb 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2569471
by robertom, jacob.embree: og_get_groups_by_user don't respect @return documentation
parent
d16275a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
og.module
og.module
+4
-4
plugins/entityreference/selection/OgSelectionHandler.class.php
...ns/entityreference/selection/OgSelectionHandler.class.php
+0
-1
No files found.
og.module
View file @
28c2d66e
...
...
@@ -3561,18 +3561,18 @@ function og_get_groups_by_user($account = NULL, $group_type = NULL) {
$account
=
$user
;
}
$gids
=
array
();
if
(
!
og_get_group_audience_fields
())
{
// User entity doesn't have group audience fields.
return
;
return
$gids
;
}
$gids
=
array
();
// Get all active OG membership that belong to the user.
$wrapper
=
entity_metadata_wrapper
(
'user'
,
$account
->
uid
);
$og_memberships
=
$wrapper
->
{
'og_membership__'
.
OG_STATE_ACTIVE
}
->
value
();
if
(
!
$og_memberships
)
{
return
;
return
$gids
;
}
foreach
(
$og_memberships
as
$og_membership
)
{
...
...
plugins/entityreference/selection/OgSelectionHandler.class.php
View file @
28c2d66e
...
...
@@ -105,7 +105,6 @@ class OgSelectionHandler extends EntityReference_SelectionHandler_Generic {
$field_mode
=
$this
->
instance
[
'field_mode'
];
$user_groups
=
og_get_groups_by_user
(
NULL
,
$group_type
);
$user_groups
=
$user_groups
?
$user_groups
:
array
();
$user_groups
=
array_merge
(
$user_groups
,
$this
->
getGidsForCreate
());
...
...
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