Posted by argiope on January 24, 2013 at 5:02am
I have created a module that uses tokens in a block for certain nodes.
But I am running into some issues with tokens and it is really weird because everything works beautifully on staging.
But on production the tokens are not being returned at all both have the exact same revision of the site checked out. Same modules slightly different config but the performance settings are the same for both. This may be a bug but I'm not sure how to reproduce it. Module works okay on a vanilla install.
And this might be the wrong forum for this post so please forgive if it is it seemed the most appropriate at the time.
Basically doing something like this:
<?php
$node = menu_get_object();
Print token_replace('[node:field]', array('node' => $node));
?>
Comments
You do not say what the
You do not say what the problem is but have you verified the token exists?
The problem is it doesn't exist
The problem is that it doesn't exist. it should be supplied by the token module using field_tokens. But it's not there.
website: http://arenestudios.com
email: ndavison@arenestudios.com
Sorry I was on my phone
Sorry I was on my phone earlier and it was hard to give a reply. The issue is the token exists if you run token_scan it returns the token and you can see it in the array returned by token_info but token_replace returns an empty string. Also it's only the ones pertaining to fields. [node:nid] works just fine.
website: http://arenestudios.com
email: ndavison@arenestudios.com
I ended up disabling both the
I ended up disabling both the entity token and token modules and then reenabled them and that seems to of resolved the issue.
website: http://arenestudios.com
email: ndavison@arenestudios.com