This issue is related to #1257470: Making modifiers translatable?

Because the purl modifiers are cached with a language key you might end up with stale cache data in certain languages.

Use case:
When creating/updating/deleting modifiers when working in an English backend purl_modifiers() is called with $reset set to TRUE. This causes the cache for purl modifiers to be rebuilt.

At the end of the rebuild cache_set() is called. The key for the cache is suffixed with the global $language->language. This means the new values are only cached for the English version.

If you surf to your new modifier in a different language chances are the new modifier is not available in the cache for that language resulting in a page not found.

Same situation the other way around, if you redirect a user with purl_goto, using your new modifier in the options, the id/value for your modifier will not be present in the cached modifiers for other language than the one you saved the modifier for.

Proposed solution
Wipe the purl_modifiers_* cache for all languages when using reset.

Comments

jover’s picture

Got the same problem with spaces_og / purl when saving a node/group (and possibly also when updating).
Temporary solution is to clear the cache on hook_node_insert() & hook_node_update().

function MYMODULE_node_insert($node) {
  if ($node->type == 'node_type') {
    cache_clear_all('purl_modifiers_', 'cache', TRUE);
  }
}

function MYMODULE_node_update($node) {
  if ($node->type == 'node_type') {
    cache_clear_all('purl_modifiers_', 'cache', TRUE);
  }
}
jover’s picture

Issue summary: View changes

Added link to related issue