diff --git a/core/lib/Drupal/Core/Controller/ControllerBase.php b/core/lib/Drupal/Core/Controller/ControllerBase.php index 1161da5..5255bc3 100644 --- a/core/lib/Drupal/Core/Controller/ControllerBase.php +++ b/core/lib/Drupal/Core/Controller/ControllerBase.php @@ -9,6 +9,7 @@ use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Routing\LinkGeneratorTrait; +use Drupal\Core\Routing\RedirectDestinationTrait; use Drupal\Core\Routing\UrlGeneratorTrait; use Drupal\Core\StringTranslation\StringTranslationTrait; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -35,8 +36,10 @@ * @ingroup menu */ abstract class ControllerBase implements ContainerInjectionInterface { - use StringTranslationTrait; + use LinkGeneratorTrait; + use RedirectDestinationTrait; + use StringTranslationTrait; use UrlGeneratorTrait; /** diff --git a/core/lib/Drupal/Core/Render/Element/Link.php b/core/lib/Drupal/Core/Render/Element/Link.php index 73ad3c42..c6714be 100644 --- a/core/lib/Drupal/Core/Render/Element/Link.php +++ b/core/lib/Drupal/Core/Render/Element/Link.php @@ -7,7 +7,6 @@ namespace Drupal\Core\Render\Element; -use Drupal\Core\Routing\RedirectDestinationTrait; use Drupal\Component\Utility\NestedArray; use Drupal\Component\Utility\Html as HtmlUtility; @@ -18,8 +17,6 @@ */ class Link extends RenderElement { - use RedirectDestinationTrait; - /** * {@inheritdoc} */ diff --git a/core/lib/Drupal/Core/Routing/RedirectDestinationTrait.php b/core/lib/Drupal/Core/Routing/RedirectDestinationTrait.php index 6810669..4ecdcde 100644 --- a/core/lib/Drupal/Core/Routing/RedirectDestinationTrait.php +++ b/core/lib/Drupal/Core/Routing/RedirectDestinationTrait.php @@ -29,7 +29,7 @@ /** * Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url. * - * @see \Drupal\Core\Routing\UrlGeneratorInterface::getAsArray() for + * @see \Drupal\Core\Routing\RedirectDestinationInterface::getAsArray() for * details. * * @return array diff --git a/core/modules/book/src/Form/BookAdminEditForm.php b/core/modules/book/src/Form/BookAdminEditForm.php index 2778ae9..ebeeba9 100644 --- a/core/modules/book/src/Form/BookAdminEditForm.php +++ b/core/modules/book/src/Form/BookAdminEditForm.php @@ -14,7 +14,6 @@ use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; -use Drupal\Core\Routing\RedirectDestinationTrait; use Drupal\Core\Url; use Drupal\node\NodeInterface; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/core/modules/forum/src/Controller/ForumController.php b/core/modules/forum/src/Controller/ForumController.php index 7cdd45f..5c84856 100644 --- a/core/modules/forum/src/Controller/ForumController.php +++ b/core/modules/forum/src/Controller/ForumController.php @@ -11,7 +11,6 @@ use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Entity\EntityAccessControlHandlerInterface; use Drupal\Core\Entity\EntityStorageInterface; -use Drupal\Core\Routing\RedirectDestinationTrait; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; use Drupal\forum\ForumManagerInterface; @@ -25,8 +24,6 @@ */ class ForumController extends ControllerBase { - use RedirectDestinationTrait; - /** * Forum manager service. * diff --git a/core/modules/locale/locale.pages.inc b/core/modules/locale/locale.pages.inc index 80cfd2a..105e505 100644 --- a/core/modules/locale/locale.pages.inc +++ b/core/modules/locale/locale.pages.inc @@ -121,5 +121,5 @@ function template_preprocess_locale_translation_last_check(array &$variables) { $last = $variables['last']; $variables['last_checked'] = ($last != NULL); $variables['time'] = \Drupal::service('date.formatter')->formatInterval(REQUEST_TIME - $last); - $variables['link'] = \Drupal::l(t('Check manually'), new Url('locale.check_translation', array(), array('query' => \Drupal::service('redirect.destination')->getAsArray()))); + $variables['link'] = \Drupal::l(t('Check manually'), new Url('locale.check_translation', array(), array('query' => \Drupal::destination()->getAsArray()))); } diff --git a/core/modules/path/src/Controller/PathController.php b/core/modules/path/src/Controller/PathController.php index 6b49992..2d51281 100644 --- a/core/modules/path/src/Controller/PathController.php +++ b/core/modules/path/src/Controller/PathController.php @@ -11,7 +11,6 @@ use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Path\AliasStorageInterface; use Drupal\Core\Path\AliasManagerInterface; -use Drupal\Core\Routing\RedirectDestinationTrait; use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; @@ -21,8 +20,6 @@ */ class PathController extends ControllerBase { - use RedirectDestinationTrait; - /** * The path alias storage. * diff --git a/core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php b/core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php index 6f7cb17..bcfc8e1 100644 --- a/core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php +++ b/core/modules/system/tests/modules/common_test/src/Controller/CommonTestController.php @@ -89,7 +89,7 @@ public function jsAndCssQuerystring() { * parameter. */ public function destination() { - $destination = \Drupal::service('redirect.destination')->getAsArray(); + $destination = \Drupal::destination()->getAsArray(); $output = "The destination: " . String::checkPlain($destination['destination']); return new Response($output); diff --git a/core/modules/user/src/Plugin/views/field/Link.php b/core/modules/user/src/Plugin/views/field/Link.php index b55a6a4..fca3d90 100644 --- a/core/modules/user/src/Plugin/views/field/Link.php +++ b/core/modules/user/src/Plugin/views/field/Link.php @@ -15,7 +15,6 @@ use Drupal\views\ResultRow; use Drupal\views\ViewExecutable; use Drupal\Core\Entity\EntityInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; /** * Field handler to present a link to the user.