core/modules/rest/src/RequestHandler.php | 22 ++-------------------- .../EntityResource/EntityResourceTestBase.php | 3 --- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/core/modules/rest/src/RequestHandler.php b/core/modules/rest/src/RequestHandler.php index 6b987f6..11a578c 100644 --- a/core/modules/rest/src/RequestHandler.php +++ b/core/modules/rest/src/RequestHandler.php @@ -35,33 +35,20 @@ class RequestHandler implements ContainerAwareInterface, ContainerInjectionInter protected $resourceStorage; /** - * The config factory. - * - * @var \Drupal\Core\Config\ConfigFactoryInterface - */ - protected $configFactory; - - /** * Creates a new RequestHandler instance. * * @param \Drupal\Core\Entity\EntityStorageInterface $entity_storage * The resource configuration storage. - * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory - * The config factory. */ - public function __construct(EntityStorageInterface $entity_storage, ConfigFactoryInterface $config_factory) { + public function __construct(EntityStorageInterface $entity_storage) { $this->resourceStorage = $entity_storage; - $this->configFactory = $config_factory; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { - return new static( - $container->get('entity_type.manager')->getStorage('rest_resource_config'), - $container->get('config.factory') - ); + return new static($container->get('entity_type.manager')->getStorage('rest_resource_config')); } /** @@ -142,11 +129,6 @@ public function handle(RouteMatchInterface $route_match, Request $request) { if ($response instanceof CacheableResponseInterface) { $response->addCacheableDependency($resource_config); - // Add global rest settings config's cache tag, for BC flags. - // @see \Drupal\rest\Plugin\rest\resource\EntityResource::permissions() - // @see \Drupal\rest\EventSubscriber\RestConfigSubscriber - // @todo Remove in https://www.drupal.org/node/2893804 - $response->addCacheableDependency($this->configFactory->get('rest.settings')); } return $response; diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index 32f0a22..11bbf46 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -294,9 +294,6 @@ protected function getExpectedUnauthorizedAccessCacheability() { protected function getExpectedCacheTags() { $expected_cache_tags = [ 'config:rest.resource.entity.' . static::$entityTypeId, - // Necessary for 'bc_entity_resource_permissions'. - // @see \Drupal\rest\Plugin\rest\resource\EntityResource::permissions() - 'config:rest.settings', ]; if (!static::$auth) { $expected_cache_tags[] = 'config:user.role.anonymous';