Commit 68e23f16 authored by alexpott's avatar alexpott

Issue #1894596 by googletorp, tstoeckler, swentel, Uccio, Gábor Hojtsy:...

Issue #1894596 by googletorp, tstoeckler, swentel, Uccio, Gábor Hojtsy: Account settings cannot be saved anymore if content translation module is installed
parent 9d11fa42
......@@ -471,7 +471,14 @@ function content_translation_language_configuration_element_process(array $eleme
);
$submit_name = isset($form['actions']['save_continue']) ? 'save_continue' : 'submit';
$form['actions'][$submit_name]['#submit'][] = 'content_translation_language_configuration_element_submit';
// Only add the submit handler on the submit button if the #submit property
// is already available, otherwise this breaks the form submit function.
if (isset($form['actions'][$submit_name]['#submit'])) {
$form['actions'][$submit_name]['#submit'][] = 'content_translation_language_configuration_element_submit';
}
else {
$form['#submit'][] = 'content_translation_language_configuration_element_submit';
}
}
return $element;
}
......
......@@ -217,6 +217,11 @@ function testAccountLanguageSettingsUI() {
$this->drupalPostForm('admin/config/people/accounts', $edit, t('Save configuration'));
$this->drupalGet('admin/config/people/accounts');
$this->assertFieldChecked('edit-language-content-translation');
// Make sure account settings can be saved.
$this->drupalPostForm('admin/config/people/accounts', array('anonymous' => 'Save me please!'), 'Save configuration');
$this->assertFieldByName('anonymous', 'Save me please!', 'Anonymous name has been changed.');
$this->assertText('The configuration options have been saved.');
}
/**
......
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