Commit b615611f authored by catch's avatar catch
Browse files

task: #3567980 Remove unneeded parameter $requestStack from EntityController

By: smustgrave
By: dcam
(cherry picked from commit 69f701f3)
(cherry picked from commit 66686fac)
parent f65431c7
Loading
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;

/**
 * Provides the add-page and title callbacks for entities.
@@ -47,7 +46,6 @@ public function __construct(
    TranslationInterface $stringTranslation,
    protected readonly UrlGeneratorInterface $urlGenerator,
    protected readonly RouteMatchInterface $routeMatch,
    protected readonly RequestStack $requestStack,
  ) {
    $this->stringTranslation = $stringTranslation;
  }
@@ -64,7 +62,6 @@ public static function create(ContainerInterface $container) {
      $container->get('string_translation'),
      $container->get('url_generator'),
      $container->get('current_route_match'),
      $container->get('request_stack'),
    );
  }

@@ -106,7 +103,7 @@ protected function redirect($route_name, array $route_parameters = [], array $op
  public function addPage($entity_type_id, ?Request $request = NULL) {
    if ($request === NULL) {
      @trigger_error('Calling ' . __METHOD__ . ' without the $request parameter is deprecated in drupal:11.3.0 and it will be required in drupal:12.0.0. See https://www.drupal.org/node/3467748', E_USER_DEPRECATED);
      $request = $this->requestStack->getCurrentRequest();
      $request = \Drupal::requestStack()->getCurrentRequest();
    }
    $entity_type = $this->entityTypeManager->getDefinition($entity_type_id);
    $bundles = $this->entityTypeBundleInfo->getBundleInfo($entity_type_id);