This is a pre-emptive issue that nobody seems to have reported yet, but it's possible that if multiple modules use token AND they use different options AND they don't flush the cache that they will get invalid responses.

In more concrete terms: if one module uses [] for prefix/suffix and the other uses %% then token will still return the [] formatted values.

Comments

drewish’s picture

i've run into a related problem in the audio module where i call token_replace() on multiple nodes to generate titles and they all end up with the same title since the tokens are cached for the first node. i'm wondering about how useful the caching actually is...

greggles’s picture

While related that seems different. This is specifically about the caching for different $options which would show up when token_replace is called multiple times for the same piece of content with different values in the $options.

cyberwolf’s picture

Subscribing.

greggles’s picture

@cyberwolf - do you have a problem related to this issue?

cyberwolf’s picture

@greggles: I'm having an issue similar to this one, but regarding caching of tokens of nodes in general (combination csm and auto_nodetitle). I went through the issue queue to subscribe to some token issues that might be causing me headaches in the future :)

dave reid’s picture

We would need to do something like:

$cache_id = array('type' => $type, 'id' => $id, 'options' => $options);
$cache_id = crc32(serialize($cache_id));
greggles’s picture

Yeah. I think the caching should be ripped out. I doubt anyone ever gets any real benefit from it.

dave reid’s picture

Status: Active » Closed (won't fix)

D5 is now unsupported, as well as Token module for D5.