diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php index 7dfb02e..9906992 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php @@ -24,7 +24,7 @@ class CommentTranslationUITest extends EntityTranslationUITest { * * @var array */ - public static $modules = array('language', 'translation_entity', 'node', 'comment'); + public static $modules = array('language', 'translation_entity', 'node', 'comment', 'field', 'field_ui'); public static function getInfo() { return array( @@ -112,4 +112,22 @@ function testTranslateLinkCommentAdminPage() { $this->assertNoLinkByHref('comment/' . $cid_untranslatable . '/translations'); } + /** + * Tests translatable column on comment fields page. + */ + function testEnabledTranslatableColumnManageFieldsTab() { + + $this->admin_user = $this->drupalCreateUser(array('administer content types', 'access administration pages', 'access content overview', 'administer nodes', 'bypass node access')); + $this->drupalLogin($this->admin_user); + $this->drupalGet('admin/structure/types/manage/' . $this->nodeBundle . '/comment/fields'); + // Check translatable table columns. + $table_headers = array( + t('Translatable'), + ); + foreach ($table_headers as $table_header) { + // We check that the label appear in the table headings. + $this->assertRaw($table_header . '', format_string('%table_header table header was found.', array('%table_header' => $table_header))); + } + } + } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php index 8cd5b49..87603a2 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php @@ -24,7 +24,7 @@ class NodeTranslationUITest extends EntityTranslationUITest { * * @var array */ - public static $modules = array('language', 'translation_entity', 'node'); + public static $modules = array('language', 'translation_entity', 'node', 'field', 'field_ui'); public static function getInfo() { return array( @@ -103,4 +103,21 @@ public function testDisabledBundle() { $this->assertEqual($enabledNode->id(), reset($rows)->entity_id); } + /** + * Tests translatable column on content type Manage fields page. + */ + function testEnabledTranslatableColumnManageFieldsTab() { + + $this->admin_user = $this->drupalCreateUser(array('administer content types', 'access administration pages', 'access content overview', 'administer nodes', 'bypass node access')); + $this->drupalLogin($this->admin_user); + $this->drupalGet('admin/structure/types/manage/' . $this->bundle . '/fields'); + // Check translatable table columns. + $table_headers = array( + t('Translatable'), + ); + foreach ($table_headers as $table_header) { + // We check that the label appear in the table headings. + $this->assertRaw($table_header . '', format_string('%table_header table header was found.', array('%table_header' => $table_header))); + } + } } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTranslationUITest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTranslationUITest.php index ba9c152..c575756 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTranslationUITest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTranslationUITest.php @@ -24,7 +24,7 @@ class TermTranslationUITest extends EntityTranslationUITest { * * @var array */ - public static $modules = array('language', 'translation_entity', 'taxonomy'); + public static $modules = array('language', 'translation_entity', 'taxonomy', 'field', 'field_ui'); public static function getInfo() { return array( @@ -139,4 +139,22 @@ function testTranslateLinkVocabularyAdminPage() { $this->assertNoLinkByHref('term/' . $untranslatable_tid . '/translations'); } + /** + * Tests translatable column on vocabulary fields page. + */ + function testEnabledTranslatableColumnManageFieldsTab() { + + $this->admin_user = $this->drupalCreateUser(array('administer taxonomy', 'access administration pages', 'administer nodes')); + $this->drupalLogin($this->admin_user); + $this->drupalGet('admin/structure/taxonomy/' . $this->bundle . '/fields'); + // Check translatable table columns. + $table_headers = array( + t('Translatable'), + ); + foreach ($table_headers as $table_header) { + // We check that the label appear in the table headings. + $this->assertRaw($table_header . '', format_string('%table_header table header was found.', array('%table_header' => $table_header))); + } + } + } diff --git a/core/modules/translation_entity/translation_entity.module b/core/modules/translation_entity/translation_entity.module index d7bd437..0a049ed 100644 --- a/core/modules/translation_entity/translation_entity.module +++ b/core/modules/translation_entity/translation_entity.module @@ -590,8 +590,6 @@ function translation_entity_form_field_ui_field_overview_form_alter(array &$form $form['fields']['#header'][] = t('Translatable'); $form['fields']['#header'][] = $operations; - $non_translatable_fields = $form['#extra']; - foreach (element_children($form['fields']) as $field => $value) { $field_row_type = $form['fields'][$value]['#row_type']; diff --git a/core/modules/user/lib/Drupal/user/Tests/UserTranslationUITest.php b/core/modules/user/lib/Drupal/user/Tests/UserTranslationUITest.php index 1b6160a..39b5b5d 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserTranslationUITest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserTranslationUITest.php @@ -24,7 +24,7 @@ class UserTranslationUITest extends EntityTranslationUITest { * * @var array */ - public static $modules = array('language', 'translation_entity', 'user'); + public static $modules = array('language', 'translation_entity', 'user', 'field' ,'field_ui'); public static function getInfo() { return array( @@ -74,4 +74,21 @@ function testTranslateLinkUserAdminPage() { $this->assertLinkByHref('user/' . $uid . '/translations'); } + /** + * Tests translatable column on accounts fields page. + */ + function testEnabledTranslatableColumnManageFieldsTab() { + + $this->admin_user = $this->drupalCreateUser(array('access administration pages', 'administer users')); + $this->drupalLogin($this->admin_user); + $this->drupalGet('admin/config/people/accounts/fields'); + // Check translatable table columns. + $table_headers = array( + t('Translatable'), + ); + foreach ($table_headers as $table_header) { + // We check that the label appear in the table headings. + $this->assertRaw($table_header . '', format_string('%table_header table header was found.', array('%table_header' => $table_header))); + } + } }