diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/field/field.info.inc | 12 | ||||
-rw-r--r-- | modules/image/image.module | 12 |
2 files changed, 18 insertions, 6 deletions
diff --git a/modules/field/field.info.inc b/modules/field/field.info.inc index 1e949b6c7..c7250eed5 100644 --- a/modules/field/field.info.inc +++ b/modules/field/field.info.inc @@ -65,18 +65,24 @@ function field_info_cache_clear() { * as well as module, giving the module that exposes the entity type. */ function _field_info_collate_types($reset = FALSE) { + global $language; static $info; // @TODO use entity_get_info(). + // The _info() hooks invoked below include translated strings, so each + // language is cached separately. + $langcode = $language->language; + if ($reset) { $info = NULL; - cache_clear_all('field_info_types', 'cache_field'); + // Clear all languages. + cache_clear_all('field_info_types:', 'cache_field', TRUE); return; } if (!isset($info)) { - if ($cached = cache_get('field_info_types', 'cache_field')) { + if ($cached = cache_get("field_info_types:$langcode", 'cache_field')) { $info = $cached->data; } else { @@ -144,7 +150,7 @@ function _field_info_collate_types($reset = FALSE) { } drupal_alter('field_storage_info', $info['storage types']); - cache_set('field_info_types', $info, 'cache_field'); + cache_set("field_info_types:$langcode", $info, 'cache_field'); } } diff --git a/modules/image/image.module b/modules/image/image.module index 8df106d8f..3d6cb2d65 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -694,7 +694,7 @@ function image_style_flush($style) { // Clear image style and effect caches. cache_clear_all('image_styles', 'cache'); - cache_clear_all('image_effects', 'cache'); + cache_clear_all('image_effects:', 'cache', TRUE); drupal_static_reset('image_styles'); drupal_static_reset('image_effects'); @@ -825,10 +825,16 @@ function image_default_style_revert($style) { * @see image_effect_definition_load() */ function image_effect_definitions() { + global $language; + + // hook_image_effect_info() includes translated strings, so each language is + // cached separately. + $langcode = $language->language; + $effects = &drupal_static(__FUNCTION__); if (!isset($effects)) { - if ($cache = cache_get('image_effects') && !empty($cache->data)) { + if ($cache = cache_get("image_effects:$langcode") && !empty($cache->data)) { $effects = $cache->data; } else { @@ -844,7 +850,7 @@ function image_effect_definitions() { }; } uasort($effects, '_image_effect_definitions_sort'); - cache_set('image_effects', $effects); + cache_set("image_effects:$langcode", $effects); } } |