Commit 0de61b4c authored by Christian Wach's avatar Christian Wach
Browse files

Ensure "Groups" reads groups-for-user from main site

parent 66c19bf4
......@@ -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;
......
Supports Markdown
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