diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php index e61ff1d..58730e1 100644 --- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -1487,16 +1487,17 @@ protected function renderAsLink($alter, $text, $tokens) { // won't occur). So, check for to see if we have a 'base:' URI, and then // extract the path component and run it throught the path validator service // to try to turn it into a routable Url object, so output path processors - // will run. Otherwise, use the Uri as-is and convert it into a Url object. + // will run. + $final_url = FALSE; if (parse_url($path, PHP_URL_SCHEME) === 'base') { - if (!$final_url = $this->getPathValidator()->getUrlIfValidWithoutAccessCheck(parse_url($path, PHP_URL_PATH))) { - $final_url = CoreUrl::fromUri($path, $options); - } - else { + if ($final_url = $this->getPathValidator()->getUrlIfValidWithoutAccessCheck(parse_url($path, PHP_URL_PATH))) { $final_url->setOptions($options); } } - else { + + // If it was not yet set, use the Uri as-is and convert it into a Url object + // with ::fromUri() + if (!$final_url) { $final_url = CoreUrl::fromUri($path, $options); }