src/Controller/RequestHandler.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/Controller/RequestHandler.php b/src/Controller/RequestHandler.php index e1a55c1..fa01773 100644 --- a/src/Controller/RequestHandler.php +++ b/src/Controller/RequestHandler.php @@ -135,22 +135,7 @@ class RequestHandler { // Only add the unserialized data if there is something there. $extra_parameters = $unserialized ? [$unserialized, $request] : [$request]; - // @todo Remove this in https://www.drupal.org/project/jsonapi/issues/2952714. - // Note that \Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber::renderResponseBody - // does normalization within a render context. This only calls a method on - // EntityResource in a render context. Because some methods generate URLs - // there, rather than during normalization. Ideally, that would not happen, - // then this would not be necessary. - $context = new RenderContext(); - $response = $this->renderer - ->executeInRenderContext($context, function () use ($resource, $action, $parameters, $extra_parameters) { - return call_user_func_array([$resource, $action], array_merge($parameters, $extra_parameters)); - }); - if (!$context->isEmpty()) { - $response->addCacheableDependency($context->pop()); - } - - return $response; + return call_user_func_array([$resource, $action], array_merge($parameters, $extra_parameters)); } /**