Skip to content

Instantly share code, notes, and snippets.

@mecmartini
Created May 14, 2018 17:13
Show Gist options
  • Save mecmartini/768eef65fcdb7f9e88fdc43c4480743c to your computer and use it in GitHub Desktop.
Save mecmartini/768eef65fcdb7f9e88fdc43c4480743c to your computer and use it in GitHub Desktop.
diff --git a/menu_token.module b/menu_token.module
index 6f0d91c..344fced 100644
--- a/menu_token.module
+++ b/menu_token.module
@@ -389,6 +389,9 @@ function replace_links_with_tokens(Token $token_service, $replace_with, $relevan
if (!empty($config_menu)) {
$configuration = unserialize($config_menu->configurationSerialized);
$links[$relevant_link['id']][$replace_with] = $token_service->replace($links[$relevant_link['id']][$replace_with], [], ["configuration" => $configuration], $bubbleableMetadata);
+ if (is_null($links[$relevant_link['id']][$replace_with])) {
+ $links[$relevant_link['id']][$replace_with] = $token_service->replace($config_menu->linkid, [], ["configuration" => $configuration], $bubbleableMetadata);
+ }
$links[$relevant_link['id']]["options"]["bubleble_metadata"] = $bubbleableMetadata;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment