diff --git a/src/Plugin/Block/UwCblLinks.php b/src/Plugin/Block/UwCblLinks.php index f41106c1adad88c7245ea403ba0ad57b0cb99e5a..b03a920672f3f9dfe258fc9704b33ea2e75545a1 100644 --- a/src/Plugin/Block/UwCblLinks.php +++ b/src/Plugin/Block/UwCblLinks.php @@ -262,6 +262,7 @@ class UwCblLinks extends BlockBase implements ContainerFactoryPluginInterface { // Get the friendly path. Anything that doesn't have // one will return the "real" path. + $value = str_replace("internal:", "", $value); $pathauto = $this->pathAliasManager ->getAliasByPath($value); @@ -455,8 +456,10 @@ class UwCblLinks extends BlockBase implements ContainerFactoryPluginInterface { // If there is a link already set, setup the details to // have the link in the title so when it is closed, // we can see what the actual is. + $value_uri = str_replace("internal:", "", $links['items'][$i]['uri'] ?? ''); + if (isset($links['items'][$i]['uri'])) { - $link = $this->t('Link (@uri)', ['@uri' => $links['items'][$i]['uri']]); + $link = $this->t('Link (@uri)', ['@uri' => $value_uri]); } else { $link = $this->t('Link'); @@ -480,7 +483,7 @@ class UwCblLinks extends BlockBase implements ContainerFactoryPluginInterface { '#autocomplete_route_parameters' => [ 'linkit_profile_id' => 'default', ], - '#default_value' => $links['items'][$i]['uri'] ?? '', + '#default_value' => $value_uri, '#required' => FALSE, ];