-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following token types are not defined but have tokens: $info['types']['menu-link'] #1901
Comments
This just happened to me. Turns out it's simply a result of disabling the Menu module (which isn't a required module, so there are use-cases for doing so). |
Hitting the same error, but with slightly different message:
Re-enabling the taxonomy module makes it go away, however this website does not need the taxonomy. I'm using this dirty, but quick hack for now to make the notice go away - replaced the following block in // Check tokens for problems.
foreach ($token_info['tokens'] as $type => $tokens) {
if (!is_array($tokens)) {
$token_problems['not-array']['problems'][] = "\$info['tokens']['$type']";
continue;
}
else {
foreach (array_keys($tokens) as $token) {
if (!is_array($tokens[$token])) {
$token_problems['not-array']['problems'][] = "\$info['tokens']['$type']['$token']";
continue;
}
elseif (!isset($tokens[$token]['name']) || !isset($tokens[$token]['description'])) {
$token_problems['missing-info']['problems'][] = "\$info['tokens']['$type']['$token']";
}
elseif (is_array($tokens[$token]['name']) || is_array($tokens[$token]['description'])) {
$token_problems['duplicate']['problems'][] = "\$info['tokens']['$type']['$token']";
}
}
}
if (!isset($token_info['types'][$type])) {
$token_problems['tokens-no-type']['problems'][] = "\$info['types']['$type']";
}
} with: // Check tokens for problems.
foreach ($token_info['tokens'] as $type => $tokens) {
if (!is_array($tokens)) {
$token_problems['not-array']['problems'][] = "\$info['tokens']['$type']";
continue;
}
else {
foreach (array_keys($tokens) as $token) {
if (!is_array($tokens[$token])) {
$token_problems['not-array']['problems'][] = "\$info['tokens']['$type']['$token']";
continue;
}
elseif (!isset($tokens[$token]['name']) || !isset($tokens[$token]['description'])) {
$token_problems['missing-info']['problems'][] = "\$info['tokens']['$type']['$token']";
}
elseif (is_array($tokens[$token]['name']) || is_array($tokens[$token]['description'])) {
$token_problems['duplicate']['problems'][] = "\$info['tokens']['$type']['$token']";
}
}
}
if (!isset($token_info['types'][$type])) {
if ($type == 'term' && !module_exists('taxonomy')) {
continue;
}
$token_problems['tokens-no-type']['problems'][] = "\$info['types']['$type']";
}
} but it must be properly fixed in core. |
Historically, this issue appears to not happen frequently, but it is annoying, so yes, it should be addressed. It's good that we now have another way to reproduce it. Thanks @alanmels 🙏🏼 |
I'm not able to reproduce. This is what I'm doing:
Am I missing a step, @alanmels? Otherwise, I guess this must be the result of a contrib module defining tokens of type |
On a clean website disable Taxonomy and enable Entity Tokens module and look at the Status page, and the notice should be there. |
Yes, that's what I'm doing. I don't see a problem in the Status page. EDIT: I re-read. OK, yes, Entity Tokens is the issue. |
OK, I was able to reproduce ONLY if:
So, the problem is not in core. The problem is that Entity Tokens defines a few custom term tokens. I'll open an issue there. |
Pardon me, I also have Entity Plus. |
Posted an issue in Entity Tokens: backdrop-contrib/entity_token#43 I'll fix that tomorrow over there. The problem is in line 98 and 104 of |
@alanmels, this is now fixed in Entity Tokens, and just did a new release of the module. Please test. |
In the meantime, I have been working on cross-ports for commits in the 7.x Token module (as part of the #5012 meta issue). This one specifically will affect how the status report messages look (the severity has been lowered for some of them for example): backdrop/backdrop#4489 |
I saw this in my status report and that's what made me decide to scrap my local dev and build a fresh one. The goal was to upgrade 1.3.5 to 1.3.7 and then to 1.4.2 and see if this is reproducible, but I've hit #1900. Maybe it means something to someone that knows how to fix it. If the fatal issue gets sorted, I'll see if this happens with the fresh install + upgrade to 1.4.2 and if not, I will close this issue here.
The text was updated successfully, but these errors were encountered: