You are here

function social_group_block_build_alter in Open Social 8.9

Same name and namespace in other branches
  1. 8.7 modules/social_features/social_group/social_group.module \social_group_block_build_alter()
  2. 8.8 modules/social_features/social_group/social_group.module \social_group_block_build_alter()
  3. 10.3.x modules/social_features/social_group/social_group.module \social_group_block_build_alter()
  4. 10.0.x modules/social_features/social_group/social_group.module \social_group_block_build_alter()
  5. 10.1.x modules/social_features/social_group/social_group.module \social_group_block_build_alter()
  6. 10.2.x modules/social_features/social_group/social_group.module \social_group_block_build_alter()

Implements hook_block_build_alter().

File

modules/social_features/social_group/social_group.module, line 1354
The Social group module.

Code

function social_group_block_build_alter(array &$build, BlockPluginInterface $block) {
  if (!empty($block
    ->getPluginId()) && ($block
    ->getPluginId() === 'views_exposed_filter_block:newest_groups-page_all_groups' || $block
    ->getPluginId() === 'views_exposed_filter_block:search_groups-page')) {

    // The Group Type filter has to listen to changes in
    // group type role permissions. Using the role list ensures
    // it's cleared correctly.
    $build['#cache']['tags'][] = 'config:group_role_list';
  }
}