Commit 4e847383 authored by alexpott's avatar alexpott

Issue #2300347 by vijaycs85, joshi.rohit100 | robertdbailey: Fixed Regression:...

Issue #2300347 by vijaycs85, joshi.rohit100 | robertdbailey: Fixed Regression: checkbox to enable translation for users does not save.
parent f0c9d009
......@@ -36,7 +36,7 @@ function setUp() {
$this->container->get('comment.manager')->addDefaultField('node', 'article', 'comment_article', CommentItemInterface::OPEN, 'comment_article');
$this->container->get('comment.manager')->addDefaultField('node', 'page', 'comment_page');
$admin_user = $this->drupalCreateUser(array('access administration pages', 'administer languages', 'administer content translation', 'administer content types', 'administer node fields', 'administer comment fields', 'administer comments', 'administer comment types'));
$admin_user = $this->drupalCreateUser(array('access administration pages', 'administer languages', 'administer content translation', 'administer content types', 'administer node fields', 'administer comment fields', 'administer comments', 'administer comment types', 'administer account settings'));
$this->drupalLogin($admin_user);
}
......@@ -183,6 +183,23 @@ function testSettingsUI() {
}
}
/**
* Tests the language settings checkbox on account settings page.
*/
function testAccountLanguageSettingsUI() {
// Make sure the checkbox is available and not checked by default.
$this->drupalGet('admin/config/people/accounts');
$this->assertField('language[content_translation]');
$this->assertNoFieldChecked('edit-language-content-translation');
$edit = array(
'language[content_translation]' => TRUE,
);
$this->drupalPostForm('admin/config/people/accounts', $edit, t('Save configuration'));
$this->drupalGet('admin/config/people/accounts');
$this->assertFieldChecked('edit-language-content-translation');
}
/**
* Asserts that translatability has the expected value for the given bundle.
*
......
......@@ -59,6 +59,7 @@ public function getFormId() {
* Implements \Drupal\Core\Form\FormInterface::buildForm().
*/
public function buildForm(array $form, array &$form_state) {
$form = parent::buildForm($form, $form_state);
$config = $this->config('user.settings');
$mail_config = $this->config('user.mail');
$site_config = $this->config('system.site');
......@@ -401,7 +402,7 @@ public function buildForm(array $form, array &$form_state) {
'#rows' => 3,
);
return parent::buildForm($form, $form_state);
return $form;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment