diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php index 0929bc8..e889994 100644 --- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -106,14 +106,6 @@ */ protected $renderer; - - /** - * Stores the path validator. - * - * @return \Drupal\Core\Path\PathValidatorInterface - */ - protected $pathValidator; - /** * Overrides Drupal\views\Plugin\views\HandlerBase::init(). */ @@ -1311,6 +1303,7 @@ protected function renderAsLink($alter, $text, $tokens) { 'entity_type' => NULL, 'fragment' => NULL, 'language' => NULL, + 'path_processing' => TRUE, 'query' => [], ); @@ -1478,26 +1471,8 @@ protected function renderAsLink($alter, $text, $tokens) { $options['entity_type'] = $alter['entity_type']; } - // We now have a heavily processed path as a URI string 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 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. - $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->setOptions($options); - } - } - - // 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); - } + // The path has been heavily processed above, so it should be used as-is. + $final_url = CoreUrl::fromUri($path, $options); // Build the link based on our altered Url object, adding on the optional // prefix and suffix @@ -1768,19 +1743,6 @@ protected function getRenderer() { return $this->renderer; } - /** - * Returns the path validator. - * - * @return \Drupal\Core\Path\PathValidatorInterface - */ - protected function getPathValidator() { - if (!isset($this->pathValidator)) { - $this->pathValidator = \Drupal::pathValidator(); - } - - return $this->pathValidator; - } - } /**