Skip to content
Snippets Groups Projects
Commit 6bf79095 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #1833076 by herom, alansaviolobo, Pancho, pixelite, jessehs, YesCT:...

Issue #1833076 by herom, alansaviolobo, Pancho, pixelite, jessehs, YesCT: Expand translation settings when editing outdated translation so remember to uncheck "needs updating".
parent 6db76f52
No related branches found
No related tags found
No related merge requests found
......@@ -242,6 +242,7 @@ public function entityFormAlter(array &$form, FormStateInterface $form_state, En
'#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.
......
......@@ -145,16 +145,19 @@ protected function doTestOutdatedStatus() {
$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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment