In a token pattern setting, tokens are replaced as markup, not plain text, by using this line of code :
```PHP
$return_value = $this->getTokenService()->replace($value, $token_data, ['clear' => TRUE]);
```
(in the `settingsPreprocess()` method of `src/Plugin/TokenSettingTypeBase.php` file)
for instance, in our case the URL produced by the custom token is an URL containing query parameters. So `/some-url?foo=aaa&bar=bbb` is rendered as `/some-url?foo=aaa&bar=bbb`, creating a wrong link.
Create a token that generates aan URL with query parameters and use it.
See incomming patch (working on it).
Active
2.4
Code