Closed (duplicate)
Project:
Token
Version:
5.x-1.6
Component:
Token Actions
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 May 2009 at 17:30 UTC
Updated:
13 May 2009 at 09:13 UTC
function token_replace($original, $type = 'global', $object = NULL, $leading = '[', $trailing = ']', $options = array()) {
$full = token_get_values($type, $object, <b>FALSE</b>, $options);
return _token_replace_tokens($original, $full->tokens, $full->values, $leading, $trailing);
In token_replace, token_get_values is called with flush set as FALSE. Could another argument be added to token_replace so that the user has control over the FLUSH?
I am batch parsing XML files to extract data. Then I use the token module to replace the tokens in an existing content type. If flush is set to FALSE, it replaces the tokens with data from the first file it read and ignores the data from the newer XML files.
I installed the development module and did some debugging. If flush is set to FALSE, it calls the hook_token_values() that I have implemented in the module only once. It does not call the hook for later token_replace().
Comments
Comment #1
derhasi commentedthis issue is allready discussed in #262360: Expose control of token caching to functions that call token_replace. A solution might be approched by watching the
$optionsor an an additional variable.