diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php index 2a34f1e..0a1a55c 100644 --- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -1476,9 +1476,15 @@ protected function renderAsLink($alter, $text, $tokens) { $options['entity_type'] = $alter['entity_type']; } - // Check to see if we have a routable path, so path processors run, - // otherise use is as-is. - if ($i = strpos($path, 'base:') === 0) { + // We now have a heavily processed path and set of options. If the + // original path was user entered, or had token replacement done to it, the + // current Url object may be unroutable and use the 'base:' scheme, + // which means outbound path processors won't run (e.g., path prefixing + // won't occur). So, check to see if we have a 'base:' path, and then + // extract the path portion 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 path as-is. + if (($i = strpos($path, 'base:')) === 0) { if (!$final_url = $this->getPathValidator()->getUrlIfValidWithoutAccessCheck(substr($url['path'], 5))) { $final_url = CoreUrl::fromUri($path, $options); }