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 906248a..5b0284d 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php @@ -274,6 +274,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 f78b799..954a401 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 @@ -112,16 +112,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-entity" 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-entity" 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);