Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
og
Commits
fb4c95eb
Commit
fb4c95eb
authored
Feb 21, 2018
by
jacob.embree
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix return value of og_get_groups_by_user() when $group_type is provided and results are empty
parent
28c2d66e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
og.module
og.module
+7
-6
No files found.
og.module
View file @
fb4c95eb
...
...
@@ -3553,7 +3553,10 @@ function og_node_create_links($group_type, $gid, $field_name, $destination = NUL
* types will be fetched.
*
* @return
* An array with the group IDs or an empty array.
* If $group_type is provided then an array of group IDs matching the
* specified group type. If $group_type is not provided then an associative
* array is returned containing arrays of group IDs keyed by group type. If
* no results are found an empty array is returned.
*/
function
og_get_groups_by_user
(
$account
=
NULL
,
$group_type
=
NULL
)
{
if
(
empty
(
$account
))
{
...
...
@@ -3581,12 +3584,10 @@ function og_get_groups_by_user($account = NULL, $group_type = NULL) {
}
}
if
(
empty
(
$group_type
))
{
return
$gids
;
}
elseif
(
!
empty
(
$gids
[
$group_type
]))
{
return
$gids
[
$group_type
];
if
(
isset
(
$group_type
))
{
return
isset
(
$gids
[
$group_type
])
?
$gids
[
$group_type
]
:
array
();
}
return
$gids
;
}
/**
...
...
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