diff core/lib/Drupal/Core/Controller/TitleResolver.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
line wrap: on
line diff
--- a/core/lib/Drupal/Core/Controller/TitleResolver.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/core/lib/Drupal/Core/Controller/TitleResolver.php	Thu Feb 28 13:21:36 2019 +0000
@@ -5,6 +5,7 @@
 use Drupal\Core\StringTranslation\StringTranslationTrait;
 use Drupal\Core\StringTranslation\TranslationInterface;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface;
 use Symfony\Component\Routing\Route;
 
 /**
@@ -21,16 +22,26 @@
   protected $controllerResolver;
 
   /**
+   * The argument resolver.
+   *
+   * @var \Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface
+   */
+  protected $argumentResolver;
+
+  /**
    * Constructs a TitleResolver instance.
    *
    * @param \Drupal\Core\Controller\ControllerResolverInterface $controller_resolver
    *   The controller resolver.
    * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
    *   The translation manager.
+   * @param \Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface $argument_resolver
+   *   The argument resolver.
    */
-  public function __construct(ControllerResolverInterface $controller_resolver, TranslationInterface $string_translation) {
+  public function __construct(ControllerResolverInterface $controller_resolver, TranslationInterface $string_translation, ArgumentResolverInterface $argument_resolver) {
     $this->controllerResolver = $controller_resolver;
     $this->stringTranslation = $string_translation;
+    $this->argumentResolver = $argument_resolver;
   }
 
   /**
@@ -43,7 +54,7 @@
     // trying to use empty values.
     if ($callback = $route->getDefault('_title_callback')) {
       $callable = $this->controllerResolver->getControllerFromDefinition($callback);
-      $arguments = $this->controllerResolver->getArguments($request, $callable);
+      $arguments = $this->argumentResolver->getArguments($request, $callable);
       $route_title = call_user_func_array($callable, $arguments);
     }
     elseif ($title = $route->getDefault('_title')) {