Problem/Motivation

STR:
- install D8 with Standard profile
- enable content_translation module
- visit admin/config/people/accounts
- submit the form
Expected result: settings are saved
Actual result: form just reloaded, settings aren't saved

What happens:
- content_translation_language_configuration_element_process() adds additional (actually the only one) submit handler to the submit button (code)
- FormBuilder::doBuildForm() checks if there are submit handlers on the submit button, and overrides form submit handlers with the given ones (code)
- FormSubmitter::executeSubmitHandlers() ignores $form['#submit'] handlers if there are handlers in $form_state->getSubmitHandlers() (code)

Proposed resolution

Option 1: Explicitly set submit handler on the submit button in ConfigFormBase::buildForm(). For example, EntityConfirmFormBase::actions() does it in this way.
Option 2: Change behavior of the content_translation module?

Remaining tasks

+ write patch
- decide if tests are required

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Leksat’s picture

Status: Active » Needs review
FileSize
597 bytes

Status: Needs review » Needs work

The last submitted patch, 1: 2534556-1.patch, failed testing.

Leksat’s picture

Status: Needs work » Needs review
FileSize
4.14 KB
Leksat’s picture

Issue summary: View changes

The patch for Option 1 is green.

Gábor Hojtsy’s picture

Makes sense to me. I think this certainly needs tests.

plach’s picture

Gábor Hojtsy’s picture

Status: Needs review » Closed (duplicate)

Sorry for not finding that issue. I knew one existed :/ +1 for closing as duplicate and moving there.

Gábor Hojtsy’s picture

Issue tags: -sprint