Commit 132a42bf authored by catch's avatar catch

Issue #2942388 by alexpott, quietone: Ensure d7_url_alias migration works for...

Issue #2942388 by alexpott, quietone: Ensure d7_url_alias migration works for paths without a slashes
parent 3b0be18a
......@@ -45982,6 +45982,12 @@
'alias' => 'firefly',
'language' => 'en',
))
->values(array(
'pid' => '6',
'source' => 'admin',
'alias' => 'source-noslash',
'language' => 'und',
))
->execute();
$connection->schema()->createTable('users', array(
......@@ -24,7 +24,9 @@ process:
source: source
delimiter: /
-
# If the source path has no slashes return a dummy default value.
plugin: extract
default: 'INVALID_NID'
index:
- 1
-
......
......@@ -48,7 +48,9 @@ protected function setUp() {
* Test the URL alias migration.
*/
public function testUrlAlias() {
$path = \Drupal::service('path.alias_storage')->load([
$alias_storage = $this->container->get('path.alias_storage');
$path = $alias_storage->load([
'source' => '/taxonomy/term/4',
'alias' => '/term33',
'langcode' => 'und',
......@@ -56,6 +58,11 @@ public function testUrlAlias() {
$this->assertIdentical('/taxonomy/term/4', $path['source']);
$this->assertIdentical('/term33', $path['alias']);
$this->assertIdentical('und', $path['langcode']);
// Alias with no slash.
$path = $alias_storage->load(['alias' => '/source-noslash']);
$this->assertSame('/admin', $path['source']);
$this->assertSame('und', $path['langcode']);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment