diff --git a/core/lib/Drupal/Core/Entity/Controller/EntityController.php b/core/lib/Drupal/Core/Entity/Controller/EntityController.php index 4e4b88b..2ecc637 100644 --- a/core/lib/Drupal/Core/Entity/Controller/EntityController.php +++ b/core/lib/Drupal/Core/Entity/Controller/EntityController.php @@ -229,7 +229,15 @@ public function title(RouteMatchInterface $route_match, EntityInterface $_entity } } + /** + * Provides a generic callback for Configuration Entities. + * + * @return array + * An empty render array. + */ public function configController() { + // Configuration entities do not have common view concept so default to an + // empty array. return []; } diff --git a/core/lib/Drupal/Core/Entity/Routing/EmptyRouteProvider.php b/core/lib/Drupal/Core/Entity/Routing/EmptyRouteProvider.php index f80c775..a5926bf 100644 --- a/core/lib/Drupal/Core/Entity/Routing/EmptyRouteProvider.php +++ b/core/lib/Drupal/Core/Entity/Routing/EmptyRouteProvider.php @@ -1,16 +1,20 @@ 'entity:' . $entity_type_id, 'entity_type' => $entity_type_id, 'serialization_class' => $entity_type->getClass(), - 'serialization_context' => [ - 'entity_type' => $entity_type_id, - ], 'label' => $entity_type->getLabel(), ); diff --git a/core/modules/rest/src/Plugin/Type/ResourcePluginManager.php b/core/modules/rest/src/Plugin/Type/ResourcePluginManager.php index fde0333..4aa46b2 100644 --- a/core/modules/rest/src/Plugin/Type/ResourcePluginManager.php +++ b/core/modules/rest/src/Plugin/Type/ResourcePluginManager.php @@ -17,13 +17,6 @@ class ResourcePluginManager extends DefaultPluginManager { /** - * {@inheritdoc} - */ - protected $defaults = [ - 'serialization_context' => [], - ]; - - /** * Constructs a new \Drupal\rest\Plugin\Type\ResourcePluginManager object. * * @param \Traversable $namespaces diff --git a/core/modules/rest/src/RequestHandler.php b/core/modules/rest/src/RequestHandler.php index 23956d0..7809d94 100644 --- a/core/modules/rest/src/RequestHandler.php +++ b/core/modules/rest/src/RequestHandler.php @@ -58,7 +58,7 @@ public function handle(RouteMatchInterface $route_match, Request $request) { $definition = $resource->getPluginDefinition(); $class = $definition['serialization_class']; try { - $unserialized = $serializer->deserialize($received, $class, $format, array('request_method' => $method) + $definition['serialization_context']); + $unserialized = $serializer->deserialize($received, $class, $format, array('request_method' => $method)); } catch (UnexpectedValueException $e) { $error['error'] = $e->getMessage();