Commit 94f4973f authored by catch's avatar catch
Browse files

Issue #1380660 by loganfsmyth: Fixed field_available_languages() static cache never cleared.

parent e4c9cb36
......@@ -1058,7 +1058,6 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->fields[0]['cardinality'] = 1;
field_update_field($this->fields[0]);
field_test_entity_info_translatable('test_entity', TRUE);
drupal_static_reset('field_available_languages');
// Create more items with different languages.
$entity = new stdClass();
......@@ -1096,7 +1095,6 @@ class EntityFieldQueryTestCase extends DrupalWebTestCase {
$this->fields[0]['translatable'] = TRUE;
field_update_field($this->fields[0]);
field_test_entity_info_translatable('test_entity', TRUE);
drupal_static_reset('field_available_languages');
// Create more items with different languages.
$entity = new stdClass();
......
......@@ -27,6 +27,7 @@
*/
function field_info_cache_clear() {
drupal_static_reset('field_view_mode_settings');
drupal_static_reset('field_available_languages');
// @todo: Remove this when field_attach_*_bundle() bundle management
// functions are moved to the entity API.
......
......@@ -2679,7 +2679,7 @@ class FieldTranslationsTestCase extends FieldTestCase {
// Test field_available_languages() behavior for untranslatable fields.
$this->field['translatable'] = FALSE;
$this->field_name = $this->field['field_name'] = $this->instance['field_name'] = drupal_strtolower($this->randomName() . '_field_name');
field_update_field($this->field);
$available_languages = field_available_languages($this->entity_type, $this->field);
$this->assertTrue(count($available_languages) == 1 && $available_languages[0] === LANGUAGE_NONE, t('For untranslatable fields only LANGUAGE_NONE is available.'));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment