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.
Core adds a "type" property to some token types, so types can extend other types. The problem is that core itself does nothing with the property, but Token module does.
We should rename the property to something more self-descriptive ("base_type"?), and add support for it token_info()/Token::info():
foreach ($token_info as &$type) {
if (isset($type['type']) && isset($token_info[$type['type']])) {
$type = NestedArray::MergeDeep($token_info[$type['type']], $type);
}
}
Let's wait until #1969540: Convert token.inc to a service gets in, so we don't have to re-roll it.
Comments
Comment #1
Dave ReidIt's used by the token tree in contrib to display information. Copying the tokens over is redundant information. I don't agree this is a bug at all, this is by design.
Comment #10
catchMoving to works as designed, there's no functional bug and it's not clear the API change would have an impact.