$data not available / empty

Created on 22 April 2014, about 11 years ago
Updated 3 February 2025, 3 months ago

I tried to create a custom node token:

Machine name: test
Type: node

PHP-Code:

dpm($data);
dpm('Hello World');

return 'test';

Test:

$node = node_load(123);
$text = '[node:test]';
$result = token_replace($text, array('node' => $node));

This always prints me "Hello World" and never the contents of $data. I also can't access $data['node'] directly - thous it's not available.
Tested with dev and current release.

Any ideas?

🐛 Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇩🇪Germany haggins

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024