Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
plugins
CiviCRM Network Groups
Commits
0de61b4c
Commit
0de61b4c
authored
Mar 11, 2019
by
Christian Wach
⚽
Browse files
Ensure "Groups" reads groups-for-user from main site
parent
66c19bf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/civicrm-network-groups-hooks.php
View file @
0de61b4c
...
...
@@ -202,9 +202,21 @@ class CiviCRM_Network_Groups_Hooks {
return
$groups
;
}
// Get user's "Groups" groups.
// Maybe switch to main site.
$switched
=
false
;
if
(
is_multisite
()
AND
!
is_main_site
()
)
{
switch_to_blog
(
get_main_site_id
()
);
$switched
=
true
;
}
// Get user's "Groups" groups on the main site.
$wp_group_ids
=
$this
->
plugin
->
wordpress
->
group_ids_get_for_user
(
$user
->
ID
);
// Switch back.
if
(
$switched
===
true
)
{
restore_current_blog
();
}
// Init allowed flag.
$allowed
=
false
;
...
...
Write
Preview
Supports
Markdown
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