summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest/tests')
-rw-r--r--modules/simpletest/tests/field_test.install11
-rw-r--r--modules/simpletest/tests/field_test.module9
2 files changed, 18 insertions, 2 deletions
diff --git a/modules/simpletest/tests/field_test.install b/modules/simpletest/tests/field_test.install
index 83beb5e42..2bb1701bf 100644
--- a/modules/simpletest/tests/field_test.install
+++ b/modules/simpletest/tests/field_test.install
@@ -7,6 +7,17 @@
*/
/**
+ * Implement hook_install().
+ */
+function field_test_install() {
+ // hook_entity_info_alter() needs to be executed as last.
+ db_update('system')
+ ->fields(array('weight' => 1))
+ ->condition('name', 'field_test')
+ ->execute();
+}
+
+/**
* Implement hook_schema().
*/
function field_test_schema() {
diff --git a/modules/simpletest/tests/field_test.module b/modules/simpletest/tests/field_test.module
index d5c35d06b..8cc99b1e9 100644
--- a/modules/simpletest/tests/field_test.module
+++ b/modules/simpletest/tests/field_test.module
@@ -93,8 +93,13 @@ function field_test_entity_info() {
* Implement hook_entity_info_alter().
*/
function field_test_entity_info_alter(&$entity_info) {
+ // Enable/disable field_test as a translation handler.
foreach (field_test_entity_info_translatable() as $obj_type => $translatable) {
- $entity_info[$obj_type]['translation_handlers']['field_test'] = TRUE;
+ $entity_info[$obj_type]['translation']['field_test'] = $translatable;
+ }
+ // Disable locale as a translation handler.
+ foreach (field_info_fieldable_types() as $obj_type => $info) {
+ $entity_info[$obj_type]['translation']['locale'] = FALSE;
}
}
@@ -646,7 +651,7 @@ function field_test_field_languages($obj_type, $field, &$languages) {
*/
function field_test_entity_info_translatable($obj_type = NULL, $translatable = NULL) {
$stored_value = &drupal_static(__FUNCTION__, array());
- if (isset($obj_type) && isset($translatable)) {
+ if (isset($obj_type)) {
$stored_value[$obj_type] = $translatable;
_field_info_collate_types(TRUE);
}