Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is an undefined index that happens on a handful of URLs on our site. When it happens it happens typically five times or so on that specific page load. I can't readily provide tools to reproduce it, but I am suggesting a way to check for expected indexes which may not exist (for some reason)
It could actually be added for each, I suppose (I see below this is $data['user'] too...)
Currently it is this:
case 'node':
$node = $data['node'];
foreach ($tokens as $name => $original) {
if ($name == 'uuid') {
$replacements[$original] = $node->uuid;
}
}
break;
I'm suggesting this:
case 'node':
if (isset($data['node'])) {
$node = $data['node'];
foreach ($tokens as $name => $original) {
if ($name == 'uuid') {
$replacements[$original] = $node->uuid;
}
}
}
break;
Comments
Comment #1
dco CreditAttribution: dco commentedI had an issue like this
Notice : Undefined variable: replacements dans uuid_tokens() (ligne 95 in [PATH]/sites/all/modules/uuid/uuid.tokens.inc).
I added on line 48 of uuid.token.inc :
Sometimes this variable is not initialized so a notice is thrown...
Could this be added ?
Comment #2
Renee S CreditAttribution: Renee S commentedThis appears to be in the latest dev now.
Comment #4
g33kg1rl CreditAttribution: g33kg1rl commentedI don't know if this is fixed because I am receiving this error on my website with the latest version of uuid. Notice: Undefined index: entity_type in uuid_tokens() (line 51 of uuid/uuid.tokens.inc).