Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
94f4973f
Commit
94f4973f
authored
Dec 30, 2011
by
Nathaniel Catchpole
Browse files
Issue
#1380660
by loganfsmyth: Fixed field_available_languages() static cache never cleared.
parent
e4c9cb36
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/modules/entity/tests/entity_query.test
View file @
94f4973f
...
...
@@ -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
();
...
...
core/modules/field/field.info.inc
View file @
94f4973f
...
...
@@ -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.
...
...
core/modules/field/tests/field.test
View file @
94f4973f
...
...
@@ -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.'));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment