Problem/Motivation

#2403307: RPC endpoints for user authentication: log in, check login status, log out added this service. This service only needs the serializer formats container parameter. It doesn't need the serializer service.

Not only is it unused, it also makes route rebuilds much more expensive, because to use the serializer service, all normalizer services must also be instantiated!

Proposed resolution

Stop injecting the serializer service.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers created an issue. See original summary.

Wim Leers’s picture

Wim Leers’s picture

Assigned: Wim Leers » Unassigned
hampercm’s picture

Status: Needs review » Reviewed & tested by the community

Nice catch! Patch looks good to me.

damiankloip’s picture

This gets the +1 from me too! Nice catch.

Status: Reviewed & tested by the community » Needs work
hampercm’s picture

Status: Needs work » Reviewed & tested by the community

Re-queueing for testbot

alexpott’s picture

Version: 8.2.x-dev » 8.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed f182e9d and pushed to 8.3.x. Thanks!

diff --git a/core/modules/serialization/src/EventSubscriber/UserRouteAlterSubscriber.php b/core/modules/serialization/src/EventSubscriber/UserRouteAlterSubscriber.php
index d114c16..2d5d78f 100644
--- a/core/modules/serialization/src/EventSubscriber/UserRouteAlterSubscriber.php
+++ b/core/modules/serialization/src/EventSubscriber/UserRouteAlterSubscriber.php
@@ -5,7 +5,6 @@
 use Drupal\Core\Routing\RouteBuildEvent;
 use Drupal\Core\Routing\RoutingEvents;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Symfony\Component\Serializer\SerializerInterface;
 
 /**
  * Alters user authentication routes to support additional serialization formats.

Unused use fixed on commit.

  • alexpott committed f182e9d on 8.3.x
    Issue #2841542 by Wim Leers: \Drupal\serialization\EventSubscriber\...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.