Skip to content
Snippets Groups Projects
Unverified Commit ba6ae831 authored by Pablo López's avatar Pablo López Committed by Pablo López
Browse files

Issue #3194413 by plopesc, firass.ziedan, Stefdewa: URL Doesn't work if the...

Issue #3194413 by plopesc, firass.ziedan, Stefdewa: URL Doesn't work if the old url have special characters like space '%20'
parent 7e9f1ed2
No related branches found
No related tags found
3 merge requests!24Issue #3395115: Add own permissions,!23Issue #3313386 by qzmenko, eugene.brit, plopesc, Alina Basarabeanu, prabuthe,...,!20Issue #3313386 by qzmenko, eugene.brit, plopesc, Alina Basarabeanu, prabuthe,...
......@@ -28,11 +28,15 @@ process:
plugin: default_value
default_value: 1
redirect_source:
plugin: callback
callable:
- '\Drupal\Component\Utility\UrlHelper'
- parse
source: source
-
plugin: callback
callable: urldecode
source: source
-
plugin: callback
callable:
- '\Drupal\Component\Utility\UrlHelper'
- parse
redirect_redirect/uri:
plugin: link_uri
validate_route: false
......
......@@ -311,7 +311,7 @@ my-source-path,https://example.com,und,302',
$records = $this->getReader()->getRecords($header);
foreach ($records as $record) {
$parsed_url = UrlHelper::parse($record['source']);
$parsed_url = UrlHelper::parse(urldecode($record['source']));
$path = $parsed_url['path'] ?? NULL;
$query = $parsed_url['query'] ?? NULL;
$hash = Redirect::generateHash($path, $query, $record['language']);
......
......@@ -2,3 +2,4 @@ source,destination,language,status_code
source-path,<front>,und,301
source-path-other?param=value,/my-path,en,302
my-source-path,https://example.com,und,304
path with%20spaces,/new space path,und,301
......@@ -57,6 +57,10 @@ class CSVRedirectTest extends MigrateTestBase {
'query' => [],
'path' => 'my-source-path',
], 'https://example.com', '304');
$this->assertRedirect(4, 'und', [
'query' => [],
'path' => 'path with spaces',
], 'base:new space path', '301');
}
/**
......@@ -94,7 +98,7 @@ class CSVRedirectTest extends MigrateTestBase {
public function providerTestRedirectDeleteCount(): array {
return [
['/artifacts/redirect_2.csv', 2],
['/artifacts/redirect.csv', 3],
['/artifacts/redirect.csv', 4],
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment