You are here

function groupmedia_post_update_group_permissions in Group Media 8

Same name and namespace in other branches
  1. 8.2 groupmedia.post_update.php \groupmedia_post_update_group_permissions()

Change views context to user.group_permissions.

File

./groupmedia.post_update.php, line 6

Code

function groupmedia_post_update_group_permissions() {
  if (\Drupal::moduleHandler()
    ->moduleExists('views')) {
    $view = \Drupal::entityTypeManager()
      ->getStorage('view')
      ->load('group_media');
    if ($view) {

      // Resave the existing view to recalculate cache contexts.
      $view
        ->save();
    }
  }
}