Commit ac65a88b authored by catch's avatar catch

Issue #3094292 by Berdir, plach, jibran, ravi.shankar: Remove usages of...

Issue #3094292 by Berdir, plach, jibran, ravi.shankar: Remove usages of deprecated path alias services and clear "DeprecationListenerTrait" entries
parent 52320cc8
......@@ -761,9 +761,9 @@
*
* A typical service definition in a *.services.yml file looks like this:
* @code
* path.alias_manager:
* path_alias.manager:
* class: Drupal\path_alias\AliasManager
* arguments: ['@path.crud', '@path_alias.whitelist', '@language_manager']
* arguments: ['@path_alias.repository', '@path_alias.whitelist', '@language_manager']
* @endcode
* Some services use other services as factories; a typical service definition
* is:
......
......@@ -1206,7 +1206,7 @@ services:
- { name: event_subscriber }
path_subscriber:
class: Drupal\Core\EventSubscriber\PathSubscriber
arguments: ['@path.alias_manager', '@path.current']
arguments: ['@path_alias.manager', '@path.current']
deprecated: 'The "%service_id%" service is deprecated. Use "path_alias.subscriber" instead. See https://drupal.org/node/3092086'
route_access_response_subscriber:
class: Drupal\Core\EventSubscriber\RouteAccessResponseSubscriber
......@@ -1340,7 +1340,7 @@ services:
- { name: route_processor_outbound, priority: 200 }
path_processor_alias:
class: Drupal\Core\PathProcessor\PathProcessorAlias
arguments: ['@path.alias_manager']
arguments: ['@path_alias.manager']
deprecated: 'The "%service_id%" service is deprecated. Use "path_alias.path_processor" instead. See https://drupal.org/node/3092086'
route_processor_csrf:
class: Drupal\Core\Access\RouteProcessorCsrf
......
......@@ -12,10 +12,10 @@
/**
* Provides a path subscriber that converts path aliases.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
* Use \Drupal\path_alias\EventSubscriber\PathAliasSubscriber.
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\path_alias\EventSubscriber\PathAliasSubscriber instead.
*
* @see https://www.drupal.org/node/3092086
* @see https://www.drupal.org/node/3092086
*/
class PathSubscriber implements EventSubscriberInterface {
......
......@@ -12,10 +12,10 @@
/**
* The default alias manager implementation.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
* Use \Drupal\path_alias\AliasManager.
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\path_alias\AliasManager instead.
*
* @see https://www.drupal.org/node/3092086
* @see https://www.drupal.org/node/3092086
*/
class AliasManager implements AliasManagerInterface, CacheDecoratorInterface {
......
......@@ -10,10 +10,10 @@
/**
* Provides the default path alias lookup operations.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
* Use \Drupal\path_alias\AliasRepository.
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\path_alias\AliasRepository instead.
*
* @see https://www.drupal.org/node/3092086
* @see https://www.drupal.org/node/3092086
*/
class AliasRepository implements AliasRepositoryInterface {
......
......@@ -11,10 +11,10 @@
/**
* Extends CacheCollector to build the path alias whitelist over time.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
* Use \Drupal\path_alias\AliasWhitelist.
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\path_alias\AliasWhitelist instead.
*
* @see https://www.drupal.org/node/3092086
* @see https://www.drupal.org/node/3092086
*/
class AliasWhitelist extends CacheCollector implements AliasWhitelistInterface {
......
......@@ -9,10 +9,10 @@
/**
* Processes the inbound path using path alias lookups.
*
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0.
* Use \Drupal\path_alias\PathProcessor\AliasPathProcessor.
* @deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use
* \Drupal\path_alias\PathProcessor\AliasPathProcessor.
*
* @see https://www.drupal.org/node/3092086
* @see https://www.drupal.org/node/3092086
*/
class PathProcessorAlias implements InboundPathProcessorInterface, OutboundPathProcessorInterface {
......
......@@ -47,6 +47,7 @@ class ContentModerationStateTest extends KernelTestBase {
'content_translation',
'text',
'workflows',
'path_alias',
];
/**
......
......@@ -106,10 +106,10 @@ public function testPathLanguageConfiguration() {
// Check priority of language for alias by source path.
$path_alias = $this->createPathAlias('/node/' . $node->id(), '/' . $custom_path, LanguageInterface::LANGCODE_NOT_SPECIFIED);
$lookup_path = $this->container->get('path.alias_manager')->getAliasByPath('/node/' . $node->id(), 'en');
$lookup_path = $this->container->get('path_alias.manager')->getAliasByPath('/node/' . $node->id(), 'en');
$this->assertEqual('/' . $english_path, $lookup_path, 'English language alias has priority.');
// Same check for language 'xx'.
$lookup_path = $this->container->get('path.alias_manager')->getAliasByPath('/node/' . $node->id(), $prefix);
$lookup_path = $this->container->get('path_alias.manager')->getAliasByPath('/node/' . $node->id(), $prefix);
$this->assertEqual('/' . $custom_language_path, $lookup_path, 'Custom language alias has priority.');
$path_alias->delete();
......
......@@ -9,7 +9,7 @@
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Form\FormBuilderInterface;
use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Path\AliasManagerInterface;
use Drupal\path_alias\AliasManagerInterface;
use Drupal\Core\Url;
use Drupal\path\Form\PathFilterForm;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -18,7 +18,7 @@
/**
* Defines a class to build a listing of path_alias entities.
*
* @see \Drupal\Core\Path\Entity\PathAlias
* @see \Drupal\path_alias\Entity\PathAlias
*/
class PathAliasListBuilder extends EntityListBuilder {
......@@ -46,7 +46,7 @@ class PathAliasListBuilder extends EntityListBuilder {
/**
* The path alias manager.
*
* @var \Drupal\Core\Path\AliasManagerInterface
* @var \Drupal\path_alias\AliasManagerInterface
*/
protected $aliasManager;
......@@ -63,7 +63,7 @@ class PathAliasListBuilder extends EntityListBuilder {
* The form builder.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
* @param \Drupal\Core\Path\AliasManagerInterface $alias_manager
* @param \Drupal\path_alias\AliasManagerInterface $alias_manager
* The path alias manager.
*/
public function __construct(EntityTypeInterface $entity_type, EntityStorageInterface $storage, Request $current_request, FormBuilderInterface $form_builder, LanguageManagerInterface $language_manager, AliasManagerInterface $alias_manager) {
......@@ -85,7 +85,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
$container->get('request_stack')->getCurrentRequest(),
$container->get('form_builder'),
$container->get('language_manager'),
$container->get('path.alias_manager')
$container->get('path_alias.manager')
);
}
......
......@@ -26,7 +26,7 @@ protected function computeValue() {
$entity = $this->getEntity();
if (!$entity->isNew()) {
/** @var \Drupal\Core\Path\AliasRepositoryInterface $path_alias_repository */
/** @var \Drupal\path_alias\AliasRepositoryInterface $path_alias_repository */
$path_alias_repository = \Drupal::service('path_alias.repository');
if ($path_alias = $path_alias_repository->lookupBySystemPath('/' . $entity->toUrl()->getInternalPath(), $this->getLangcode())) {
......
......@@ -14,9 +14,9 @@ abstract class UrlAliasBase extends DrupalSqlBase {
*/
public function query() {
// The order of the migration is significant since
// \Drupal\Core\Path\AliasRepository::lookupPathAlias() orders by pid before
// returning a result. Postgres does not automatically order by primary key
// therefore we need to add a specific order by.
// \Drupal\path_alias\AliasRepository::lookupPathAlias() orders by pid
// before returning a result. Postgres does not automatically order by
// primary key therefore we need to add a specific order by.
return $this->select('url_alias', 'ua')->fields('ua')->orderBy('pid');
}
......
......@@ -120,7 +120,7 @@ public function testAdminAlias() {
$this->assertText($node1->label(), 'Changed alias works.');
$this->assertResponse(200);
$this->container->get('path.alias_manager')->cacheClear();
$this->container->get('path_alias.manager')->cacheClear();
// Confirm that previous alias no longer works.
$this->drupalGet($previous);
$this->assertNoText($node1->label(), 'Previous alias no longer works.');
......
......@@ -101,7 +101,7 @@ public function testAliasTranslation() {
$this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
// Clear the path lookup cache.
$this->container->get('path.alias_manager')->cacheClear();
$this->container->get('path_alias.manager')->cacheClear();
// Languages are cached on many levels, and we need to clear those caches.
$this->container->get('language_manager')->reset();
......@@ -172,18 +172,18 @@ public function testAliasTranslation() {
// The alias manager has an internal path lookup cache. Check to see that
// it has the appropriate contents at this point.
$this->container->get('path.alias_manager')->cacheClear();
$french_node_path = $this->container->get('path.alias_manager')->getPathByAlias('/' . $french_alias, 'fr');
$this->container->get('path_alias.manager')->cacheClear();
$french_node_path = $this->container->get('path_alias.manager')->getPathByAlias('/' . $french_alias, 'fr');
$this->assertEqual($french_node_path, '/node/' . $english_node_french_translation->id(), 'Normal path works.');
// Second call should return the same path.
$french_node_path = $this->container->get('path.alias_manager')->getPathByAlias('/' . $french_alias, 'fr');
$french_node_path = $this->container->get('path_alias.manager')->getPathByAlias('/' . $french_alias, 'fr');
$this->assertEqual($french_node_path, '/node/' . $english_node_french_translation->id(), 'Normal path is the same.');
// Confirm that the alias works.
$french_node_alias = $this->container->get('path.alias_manager')->getAliasByPath('/node/' . $english_node_french_translation->id(), 'fr');
$french_node_alias = $this->container->get('path_alias.manager')->getAliasByPath('/node/' . $english_node_french_translation->id(), 'fr');
$this->assertEqual($french_node_alias, '/' . $french_alias, 'Alias works.');
// Second call should return the same alias.
$french_node_alias = $this->container->get('path.alias_manager')->getAliasByPath('/node/' . $english_node_french_translation->id(), 'fr');
$french_node_alias = $this->container->get('path_alias.manager')->getAliasByPath('/node/' . $english_node_french_translation->id(), 'fr');
$this->assertEqual($french_node_alias, '/' . $french_alias, 'Alias is the same.');
// Confirm that the alias is removed if the translation is deleted.
......
......@@ -44,7 +44,7 @@ protected function setUp() {
* Test creating, loading, updating and deleting aliases through PathItem.
*/
public function testPathItem() {
/** @var \Drupal\Core\Path\AliasRepositoryInterface $alias_repository */
/** @var \Drupal\path_alias\AliasRepositoryInterface $alias_repository */
$alias_repository = \Drupal::service('path_alias.repository');
$node_storage = \Drupal::entityTypeManager()->getStorage('node');
......
......@@ -106,7 +106,7 @@ public function preSave(EntityStorageInterface $storage) {
public function postSave(EntityStorageInterface $storage, $update = TRUE) {
parent::postSave($storage, $update);
$alias_manager = \Drupal::service('path.alias_manager');
$alias_manager = \Drupal::service('path_alias.manager');
$alias_manager->cacheClear($this->getPath());
if ($update) {
$alias_manager->cacheClear($this->original->getPath());
......@@ -119,7 +119,7 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) {
public static function postDelete(EntityStorageInterface $storage, array $entities) {
parent::postDelete($storage, $entities);
$alias_manager = \Drupal::service('path.alias_manager');
$alias_manager = \Drupal::service('path_alias.manager');
foreach ($entities as $entity) {
$alias_manager->cacheClear($entity->getPath());
}
......
......@@ -119,7 +119,7 @@ protected function assertUrlOutboundAlter($original, $final) {
*/
protected function assertUrlInboundAlter($original, $final) {
// Test inbound altering.
$result = $this->container->get('path.alias_manager')->getPathByAlias($original);
$result = $this->container->get('path_alias.manager')->getPathByAlias($original);
return $this->assertIdentical($result, $final, new FormattableMarkup('Altered inbound URL %original, expected %final, and got %result.', ['%original' => $original, '%final' => $final, '%result' => $result]));
}
......
......@@ -12,7 +12,7 @@
/**
* Tests path alias CRUD and lookup functionality.
*
* @coversDefaultClass \Drupal\Core\Path\AliasRepository
* @coversDefaultClass \Drupal\path_alias\AliasRepository
*
* @group path_alias
*/
......@@ -61,12 +61,12 @@ public function testLookupByAlias() {
}
/**
* @covers \Drupal\Core\Path\AliasManager::getPathByAlias
* @covers \Drupal\Core\Path\AliasManager::getAliasByPath
* @covers \Drupal\path_alias\AliasManager::getPathByAlias
* @covers \Drupal\path_alias\AliasManager::getAliasByPath
*/
public function testLookupPath() {
// Create AliasManager and Path object.
$aliasManager = $this->container->get('path.alias_manager');
$aliasManager = $this->container->get('path_alias.manager');
// Test the situation where the source is the same for multiple aliases.
// Start with a language-neutral alias, which we will override.
......
......@@ -45,7 +45,7 @@ public function testPathHooks() {
$alias_manager = $this->prophesize(AliasManagerInterface::class);
$alias_manager->cacheClear(Argument::any())->shouldBeCalledTimes(1);
$alias_manager->cacheClear($path_alias->getPath())->shouldBeCalledTimes(1);
\Drupal::getContainer()->set('path.alias_manager', $alias_manager->reveal());
\Drupal::getContainer()->set('path_alias.manager', $alias_manager->reveal());
$path_alias->save();
$new_source = '/' . $this->randomMachineName();
......@@ -56,7 +56,7 @@ public function testPathHooks() {
$alias_manager->cacheClear(Argument::any())->shouldBeCalledTimes(2);
$alias_manager->cacheClear($path_alias->getPath())->shouldBeCalledTimes(1);
$alias_manager->cacheClear($new_source)->shouldBeCalledTimes(1);
\Drupal::getContainer()->set('path.alias_manager', $alias_manager->reveal());
\Drupal::getContainer()->set('path_alias.manager', $alias_manager->reveal());
$path_alias->setPath($new_source);
$path_alias->save();
......@@ -64,7 +64,7 @@ public function testPathHooks() {
$alias_manager = $this->prophesize(AliasManagerInterface::class);
$alias_manager->cacheClear(Argument::any())->shouldBeCalledTimes(1);
$alias_manager->cacheClear($new_source)->shouldBeCalledTimes(1);
\Drupal::getContainer()->set('path.alias_manager', $alias_manager->reveal());
\Drupal::getContainer()->set('path_alias.manager', $alias_manager->reveal());
$path_alias->delete();
}
......
......@@ -4,7 +4,7 @@
use Drupal\Core\Language\Language;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Path\AliasRepositoryInterface;
use Drupal\path_alias\AliasRepositoryInterface;
use Drupal\path_alias\AliasManager;
use Drupal\Tests\UnitTestCase;
......@@ -31,7 +31,7 @@ class AliasManagerTest extends UnitTestCase {
/**
* Alias repository.
*
* @var \Drupal\Core\Path\AliasRepositoryInterface|\PHPUnit\Framework\MockObject\MockObject
* @var \Drupal\path_alias\AliasRepositoryInterface|\PHPUnit\Framework\MockObject\MockObject
*/
protected $aliasRepository;
......
......@@ -3,11 +3,11 @@
namespace Drupal\system\Form;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Path\AliasManagerInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Path\PathValidatorInterface;
use Drupal\Core\Routing\RequestContext;
use Drupal\path_alias\AliasManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......@@ -20,7 +20,7 @@ class SiteInformationForm extends ConfigFormBase {
/**
* The path alias manager.
*
* @var \Drupal\Core\Path\AliasManagerInterface
* @var \Drupal\path_alias\AliasManagerInterface
*/
protected $aliasManager;
......@@ -43,7 +43,7 @@ class SiteInformationForm extends ConfigFormBase {
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The factory for configuration objects.
* @param \Drupal\Core\Path\AliasManagerInterface $alias_manager
* @param \Drupal\path_alias\AliasManagerInterface $alias_manager
* The path alias manager.
* @param \Drupal\Core\Path\PathValidatorInterface $path_validator
* The path validator.
......@@ -52,7 +52,6 @@ class SiteInformationForm extends ConfigFormBase {
*/
public function __construct(ConfigFactoryInterface $config_factory, AliasManagerInterface $alias_manager, PathValidatorInterface $path_validator, RequestContext $request_context) {
parent::__construct($config_factory);
$this->aliasManager = $alias_manager;
$this->pathValidator = $path_validator;
$this->requestContext = $request_context;
......@@ -64,7 +63,7 @@ public function __construct(ConfigFactoryInterface $config_factory, AliasManager
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('path.alias_manager'),
$container->get('path_alias.manager'),
$container->get('path.validator'),
$container->get('router.request_context')
);
......
......@@ -4,10 +4,10 @@
use Drupal\Core\Condition\ConditionPluginBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Path\AliasManagerInterface;
use Drupal\Core\Path\CurrentPathStack;
use Drupal\Core\Path\PathMatcherInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\path_alias\AliasManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RequestStack;
......@@ -24,7 +24,7 @@ class RequestPath extends ConditionPluginBase implements ContainerFactoryPluginI
/**
* An alias manager to find the alias for the current system path.
*
* @var \Drupal\Core\Path\AliasManagerInterface
* @var \Drupal\path_alias\AliasManagerInterface
*/
protected $aliasManager;
......@@ -52,7 +52,7 @@ class RequestPath extends ConditionPluginBase implements ContainerFactoryPluginI
/**
* Constructs a RequestPath condition plugin.
*
* @param \Drupal\Core\Path\AliasManagerInterface $alias_manager
* @param \Drupal\path_alias\AliasManagerInterface $alias_manager
* An alias manager to find the alias for the current system path.
* @param \Drupal\Core\Path\PathMatcherInterface $path_matcher
* The path matcher service.
......@@ -80,7 +80,7 @@ public function __construct(AliasManagerInterface $alias_manager, PathMatcherInt
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static(
$container->get('path.alias_manager'),
$container->get('path_alias.manager'),
$container->get('path.matcher'),
$container->get('request_stack'),
$container->get('path.current'),
......
......@@ -2,7 +2,7 @@
namespace Drupal\system\Tests\Routing;
use Drupal\Core\Path\AliasManagerInterface;
use Drupal\path_alias\AliasManagerInterface;
/**
* An easily configurable mock alias manager.
......
......@@ -5,8 +5,8 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Path\AliasManagerInterface;
use Drupal\Core\Path\CurrentPathStack;
use Drupal\path_alias\AliasManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......@@ -24,7 +24,7 @@ class Raw extends ArgumentDefaultPluginBase implements CacheableDependencyInterf
/**
* The alias manager.
*
* @var \Drupal\Core\Path\AliasManagerInterface
* @var \Drupal\path_alias\AliasManagerInterface
*/
protected $aliasManager;
......@@ -44,14 +44,13 @@ class Raw extends ArgumentDefaultPluginBase implements CacheableDependencyInterf
* The plugin_id for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Path\AliasManagerInterface $alias_manager
* @param \Drupal\path_alias\AliasManagerInterface $alias_manager
* The alias manager.
* @param \Drupal\Core\Path\CurrentPathStack $current_path
* The current path.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, AliasManagerInterface $alias_manager, CurrentPathStack $current_path) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->aliasManager = $alias_manager;
$this->currentPath = $current_path;
}
......@@ -64,7 +63,7 @@ public static function create(ContainerInterface $container, array $configuratio
$configuration,
$plugin_id,
$plugin_definition,
$container->get('path.alias_manager'),
$container->get('path_alias.manager'),
$container->get('path.current')
);
}
......
......@@ -3,6 +3,7 @@
namespace Drupal\Tests\views\Unit\Plugin\argument_default;
use Drupal\Core\Path\CurrentPathStack;
use Drupal\path_alias\AliasManagerInterface;
use Drupal\Tests\UnitTestCase;
use Drupal\views\Plugin\views\argument_default\Raw;
use Symfony\Component\HttpFoundation\Request;
......@@ -33,7 +34,7 @@ public function testGetArgument() {
$view->expects($this->any())
->method('getRequest')
->will($this->returnValue($request));
$alias_manager = $this->createMock('Drupal\Core\Path\AliasManagerInterface');
$alias_manager = $this->createMock(AliasManagerInterface::class);
$alias_manager->expects($this->never())
->method('getAliasByPath');
......@@ -71,7 +72,7 @@ public function testGetArgument() {
$this->assertEquals(NULL, $raw->getArgument());
// Setup an alias manager with a path alias.
$alias_manager = $this->createMock('Drupal\Core\Path\AliasManagerInterface');
$alias_manager = $this->createMock(AliasManagerInterface::class);
$alias_manager->expects($this->any())
->method('getAliasByPath')
->with($this->equalTo('/test/example'))
......
......@@ -323,7 +323,7 @@ function views_ui_views_analyze(ViewExecutable $view) {
continue;
}
if ($display->hasPath() && $path = $display->getOption('path')) {
$normal_path = \Drupal::service('path.alias_manager')->getPathByAlias($path);
$normal_path = \Drupal::service('path_alias.manager')->getPathByAlias($path);
if ($path != $normal_path) {
$ret[] = Analyzer::formatMessage(t('You have configured display %display with a path which is an path alias as well. This might lead to unwanted effects so better use an internal path.', ['%display' => $display->display['display_title']]), 'warning');
}
......
......@@ -2,7 +2,7 @@
namespace Drupal\workspaces\EventSubscriber;
use Drupal\Core\Path\AliasManagerInterface;
use Drupal\path_alias\AliasManagerInterface;
use Drupal\Core\Path\CurrentPathStack;
use Drupal\Core\Routing\CacheableRouteProviderInterface;
use Drupal\Core\Routing\RouteProviderInterface;
......@@ -20,7 +20,7 @@ class WorkspaceRequestSubscriber implements EventSubscriberInterface {
/**
* The alias manager that caches alias lookups based on the request.
*
* @var \Drupal\Core\Path\AliasManagerInterface
* @var \Drupal\path_alias\AliasManagerInterface
*/
protected $aliasManager;
......@@ -48,7 +48,7 @@ class WorkspaceRequestSubscriber implements EventSubscriberInterface {
/**
* Constructs a new WorkspaceRequestSubscriber instance.
*
* @param \Drupal\Core\Path\AliasManagerInterface $alias_manager
* @param \Drupal\path_alias\AliasManagerInterface $alias_manager
* The alias manager.
* @param \Drupal\Core\Path\CurrentPathStack $current_path
* The current path.
......
......@@ -265,7 +265,7 @@ protected function doSwitchWorkspace($workspace) {
// Clear the static cache for path aliases. We can't inject the path alias
// manager service because it would create a circular dependency.
\Drupal::service('path.alias_manager')->cacheClear();
\Drupal::service('path_alias.manager')->cacheClear();
}
/**
......
......@@ -25,6 +25,7 @@ class EntityReferenceSupportedNewEntitiesConstraintValidatorTest extends KernelT
'user',
'workspaces',
'entity_test',
'path_alias',
];
/**
......
......@@ -25,6 +25,7 @@ class WorkspaceAccessTest extends KernelTestBase {
'system',
'workspaces',
'workspace_access_test',
'path_alias',
];
/**
......
......@@ -53,6 +53,7 @@ class WorkspaceCRUDTest extends KernelTestBase {
'filter',
'node',
'text',
'path_alias',
];
/**
......
......@@ -67,6 +67,7 @@ class WorkspaceIntegrationTest extends KernelTestBase {
'views',
'language',
'content_translation',
'path_alias',
];
/**
......
......@@ -45,6 +45,7 @@ class WorkspaceMergerTest extends KernelTestBase {
'text',
'user',
'system',
'path_alias',
];
/**
......
......@@ -2,7 +2,7 @@
namespace Drupal\Tests\workspaces\Unit;
use Drupal\Core\Path\AliasManagerInterface;
use Drupal\path_alias\AliasManagerInterface;
use Drupal\Core\Path\CurrentPathStack;
use Drupal\Core\Routing\CacheableRouteProviderInterface;
use Drupal\Core\Routing\RouteProviderInterface;
......@@ -20,7 +20,7 @@
class WorkspaceRequestSubscriberTest extends UnitTestCase {
/**
* @var \Drupal\Core\Path\AliasManagerInterface
* @var \Drupal\path_alias\AliasManagerInterface
*/
protected $aliasManager;
......
......@@ -40,7 +40,7 @@ services:
- { name: 'event_subscriber' }
workspaces.workspace_subscriber:
class: Drupal\workspaces\EventSubscriber\WorkspaceRequestSubscriber
arguments: ['@path.alias_manager', '@path.current', '@router.route_provider', '@workspaces.manager']
arguments: ['@path_alias.manager', '@path.current', '@router.route_provider', '@workspaces.manager']
tags:
- { name: event_subscriber }
......
......@@ -8,7 +8,7 @@
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\File\Exception\FileException;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\Path\AliasManagerInterface;
use Drupal\path_alias\AliasManagerInterface;
use Drupal\Core\State\StateInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......@@ -23,7 +23,7 @@ class InstallHelper implements ContainerInjectionInterface {
/**
* The path alias manager.
*
* @var \Drupal\Core\Path\AliasManagerInterface
* @var \Drupal\path_alias\AliasManagerInterface
*/
protected $aliasManager;
......@@ -99,7 +99,7 @@ class InstallHelper implements ContainerInjectionInterface {
/**
* Constructs a new InstallHelper object.
*
* @param \Drupal\Core\Path\AliasManagerInterface $aliasManager
* @param \Drupal\path_alias\AliasManagerInterface $aliasManager
* The path alias manager.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
* Entity type manager.
......@@ -127,7 +127,7 @@ public function __construct(AliasManagerInterface $aliasManager, EntityTypeManag
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('path.alias_manager'),
$container->get('path_alias.manager'),
$container->get('entity_type.manager'),
$container->get('module_handler'),
$container->get('state'),
......
......@@ -28,7 +28,7 @@ class DefaultConfigTest extends KernelTestBase {
/**
* {@inheritdoc}
*/
public static $modules = ['system', 'user'];
public static $modules = ['system', 'user', 'path_alias'];
/**
* The following config entries are changed on module install.
......
......@@ -63,7 +63,7 @@ protected function setUp() {
// Set a mock alias manager in the container.
$this->aliasManager = new MockAliasManager();
$this->container->set('path.alias_manager', $this->aliasManager);
$this->container->set('path_alias.manager', $this->aliasManager);
// Set the test request stack in the container.
$this->requestStack = new RequestStack();
......
......@@ -576,8 +576,8 @@ public function testRouteCaching() {
// A path with a path alias.
$this->createPathAlias('/path/add/one', '/path/add-one');
/** @var \Drupal\Core\Path\AliasManagerInterface $alias_manager */
$alias_manager = \Drupal::service('path.alias_manager');
/** @var \Drupal\path_alias\AliasManagerInterface $alias_manager */
$alias_manager = \Drupal::service('path_alias.manager');
$alias_manager->cacheClear();
$path = '/path/add-one';
......