From 5227ebcf2256bd55d980dc27b2b70c14bd8ab513 Mon Sep 17 00:00:00 2001 From: Jesse Hofmann-Smith Date: Sun, 10 Mar 2013 19:31:58 -0700 Subject: [PATCH] expanding translation fieldset for outdated translations --- .../EntityTranslationController.php | 1 + .../Tests/EntityTranslationUITest.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php index ce9d3a0..fc88af4 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php @@ -273,6 +273,7 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac '#default_value' => $translate, '#description' => t('When this option is checked, this translation needs to be updated. Uncheck when the translation is up to date again.'), ); + $form['translation_entity']['#collapsed'] = FALSE; } $name = $new_translation ? $GLOBALS['user']->name : user_load($entity->translation[$form_langcode]['uid'])->name; diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationUITest.php b/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationUITest.php index 16eb88b..001c2da 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationUITest.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationUITest.php @@ -111,16 +111,19 @@ protected function assertOutdatedStatus() { $this->drupalPost($langcode . '/' . $this->controller->getEditPath($entity), $edit, $this->getFormSubmitAction($entity)); $entity = entity_load($this->entityType, $this->entityId, TRUE); - // Check that every translation has the correct "outdated" status. + // Check that every translation has the correct "outdated" status, and that + // the Translation fieldset is open if the translation is "outdated". foreach ($this->langcodes as $enabled_langcode) { $prefix = $enabled_langcode != $default_langcode ? $enabled_langcode . '/' : ''; $path = $prefix . $this->controller->getEditPath($entity); $this->drupalGet($path); if ($enabled_langcode == $langcode) { $this->assertFieldByXPath('//input[@name="translation_entity[retranslate]"]', FALSE, 'The retranslate flag is not checked by default.'); + $this->assertFalse($this->xpath('//details[@id="edit-translation" and @open="open"]'), 'The translation tab should be collapsed by default.'); } else { $this->assertFieldByXPath('//input[@name="translation_entity[outdated]"]', TRUE, 'The translate flag is checked by default.'); + $this->assertTrue($this->xpath('//details[@id="edit-translation" and @open="open"]'), 'The translation tab is correctly expanded when the translation is outdated.'); $edit = array('translation_entity[outdated]' => FALSE); $this->drupalPost($path, $edit, $this->getFormSubmitAction($entity)); $this->drupalGet($path); -- 1.7.5.4