summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-11-03 10:23:47 (GMT)
committerAlex Pott2014-11-03 10:23:47 (GMT)
commit6bf79095fec110fee23993cf6e08dad50f6314b9 (patch)
tree6190f47a2e9c012c0acb7a5e7f1ec0be540df24a
parent6db76f529faee0d47bd7e8b48b342f5ca6672f0f (diff)
Issue #1833076 by herom, alansaviolobo, Pancho, pixelite, jessehs, YesCT: Expand translation settings when editing outdated translation so remember to uncheck "needs updating".
-rw-r--r--core/modules/content_translation/src/ContentTranslationHandler.php1
-rw-r--r--core/modules/content_translation/src/Tests/ContentTranslationUITest.php5
2 files changed, 5 insertions, 1 deletions
diff --git a/core/modules/content_translation/src/ContentTranslationHandler.php b/core/modules/content_translation/src/ContentTranslationHandler.php
index 6b19b9d..b1b6e9b 100644
--- a/core/modules/content_translation/src/ContentTranslationHandler.php
+++ b/core/modules/content_translation/src/ContentTranslationHandler.php
@@ -242,6 +242,7 @@ class ContentTranslationHandler implements ContentTranslationHandlerInterface {
'#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['content_translation']['#open'] = TRUE;
}
// Default to the anonymous user.
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationUITest.php b/core/modules/content_translation/src/Tests/ContentTranslationUITest.php
index 58d0c59..5e8497b 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationUITest.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationUITest.php
@@ -145,16 +145,19 @@ abstract class ContentTranslationUITest extends ContentTranslationTestBase {
$this->drupalPostForm($langcode . '/' . $edit_path, $edit, $this->getFormSubmitAction($entity, $langcode));
$entity = entity_load($this->entityTypeId, $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 $added_langcode) {
$prefix = $added_langcode != $default_langcode ? $added_langcode . '/' : '';
$path = $prefix . $edit_path;
$this->drupalGet($path);
if ($added_langcode == $langcode) {
$this->assertFieldByXPath('//input[@name="content_translation[retranslate]"]', FALSE, 'The retranslate flag is not checked by default.');
+ $this->assertFalse($this->xpath('//details[@id="edit-content-translation" and @open="open"]'), 'The translation tab should be collapsed by default.');
}
else {
$this->assertFieldByXPath('//input[@name="content_translation[outdated]"]', TRUE, 'The translate flag is checked by default.');
+ $this->assertTrue($this->xpath('//details[@id="edit-content-translation" and @open="open"]'), 'The translation tab is correctly expanded when the translation is outdated.');
$edit = array('content_translation[outdated]' => FALSE);
$this->drupalPostForm($path, $edit, $this->getFormSubmitAction($entity, $added_langcode));
$this->drupalGet($path);