Skip to content
Snippets Groups Projects
Commit 6970ac07 authored by Szczepan Musiał's avatar Szczepan Musiał Committed by Szczepan Musiał
Browse files

Issue #3340526 by lamp5: Allow to use extra token <term_hierarchy:> like url

parent 619b5a15
No related branches found
No related tags found
No related merge requests found
......@@ -243,7 +243,6 @@ class CustomBreadcrumbsForm extends EntityForm {
$pages = $values['breadcrumbPaths'];
$urlList = [];
$urlList = explode(PHP_EOL, $pages);
foreach ($urlList as $url) {
......@@ -251,7 +250,7 @@ class CustomBreadcrumbsForm extends EntityForm {
$trimUrl = trim($url);
// Validate Slash.
if ($trimUrl !== '<front>' && $trimUrl !== '<nolink>' && $trimUrl[0] !== '/' && $trimUrl[0] !== '[') {
if ($trimUrl !== '<front>' && $trimUrl !== '<nolink>' && $trimUrl[0] !== '/' && $trimUrl[0] !== '[' && !str_contains($trimUrl, '<term_hierarchy:')) {
$form_state->setErrorByName('pages', $this->t("@url needs to start with a slash if it is a URL or with a square bracket if it is a token.", ['@url' => $trimUrl]));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment