Commit b542c0ce authored by Kristiaan Van den Eynde's avatar Kristiaan Van den Eynde
Browse files

Removed the unsafe group_membership.roles.permissions cache context instead of deprecating it.

parent 4e7d8aa6
Loading
Loading
Loading
Loading
+1 −1
Changes for group.install: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -436,7 +436,7 @@ function group_update_8015() {
        $cache_metadata_key = "display.$display.cache_metadata";
        $cache_metadata = $view->get($cache_metadata_key);

        // Remove the deprecated cache context and add the updated metadata.
        // Remove the deleted cache context and add the updated metadata.
        if ($key = array_search('group_membership.roles.permissions', $cache_metadata['contexts'])) {
          unset($cache_metadata['tags'][$key]);
        }
−5
Changes for group.services.yml: 0 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -59,11 +59,6 @@ services:
    arguments: ['@current_route_match', '@current_user', '@entity_type.manager']
    tags:
      - { name: 'cache.context'}
  cache_context.group_membership.roles.permissions:
    class: 'Drupal\group\Cache\Context\GroupMembershipPermissionsCacheContext'
    arguments: ['@current_route_match', '@current_user', '@entity_type.manager', '@group.permissions_hash_generator']
    tags:
      - { name: 'cache.context'}
  cache_context.route.group:
    class: 'Drupal\group\Cache\Context\RouteGroupCacheContext'
    arguments: ['@current_route_match', '@entity_type.manager']
+1 −1
Changes for modules/gnode/gnode.install: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ function gnode_update_8006() {
        $cache_metadata_key = "display.$display.cache_metadata";
        $cache_metadata = $view->get($cache_metadata_key);

        // Remove the deprecated cache context and add the updated metadata.
        // Remove the deleted cache context and add the updated metadata.
        if ($key = array_search('group_membership.roles.permissions', $cache_metadata['contexts'])) {
          unset($cache_metadata['tags'][$key]);
        }
−98

File deleted.

+1 −1
Changes for src/Cache/Context/GroupMembershipRolesCacheContext.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ use Drupal\Core\Cache\Context\CalculatedCacheContextInterface;
 *
 * Only use this cache context when checking explicitly for certain roles. For
 * instance when you want to show a block listing all of the member's roles. Use
 * group_membership.roles.permissions for anything that checks permissions.
 * user.group_permissions for anything that checks permissions.
 *
 * Please note: This cache context uses the group from the current route as the
 * value object to work with. This context is therefore only to be used with