diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php index 46a7f75..6d4badf 100644 --- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -1322,14 +1322,14 @@ protected function renderAsLink($alter, $text, $tokens) { $path = $alter['url']->setOptions($options)->toUriString(); // strip_tags() removes , so check whether its different to front. - if ($path != '') { + if ($path != 'route:') { // Use strip tags as there should never be HTML in the path. // However, we need to preserve special characters like " that // were removed by String::checkPlain(). $path = strip_tags(String::decodeEntities($this->viewsTokenReplace($path, $tokens))); - if (!empty($alter['path_case']) && $alter['path_case'] != 'none') { - $path = $this->caseTransform($path, $this->options['alter']['path_case']); + if (!empty($alter['path_case']) && $alter['path_case'] != 'none' && !$alter['url']->isRouted()) { + $path = str_replace($alter['path'], $this->caseTransform($alter['path'], $this->options['alter']['path_case']), $path); } if (!empty($alter['replace_spaces'])) { @@ -1362,7 +1362,8 @@ protected function renderAsLink($alter, $text, $tokens) { if ($alter['external']) { if (!isset($url['scheme'])) { // There is no scheme, add the default 'http://' to the $path. - $path = "http://$path"; + // Use the original $alter['path'] instead of the parsed version. + $path = "http://" . $alter['path']; // Reset the $url array to include the new scheme. $url = UrlHelper::parse($path); }