Eca Form kills widget selection in Entity Browsers

Issue information

From user: FloGe

Contribution record

Fork management

Problem/Motivation

Editors are reporting that they cannot switch widgets in entity browsers. Since entity browsers do a lot aax stuff I checked in Dveloper console of Browsers. this revealed that on widget selection the ajax request for the other widget is redirected to the default widget with an 303 response.

Since entity browsers work in other Drupal instances as expected I searched for modules possibly causing this issue. Deactivating ECA Form module restores the functionality of entity browsers.

Until now I could trace the issue to

core/lib/Drupal/Core/Form/FormSubmitter.php line 53 and following :

$this->executeSubmitHandlers($form, $form_state);

    // If batches were set in the submit handlers, we process them now,
    // possibly ending execution. We make sure we do not react to the batch
    // that is already being processed (if a batch operation performs a
    // \Drupal\Core\Form\FormBuilderInterface::submitForm).
    if ($batch = &$this->batchGet() && !isset($batch['current_set'])) {
      // Store $form_state information in the batch definition.
      $batch['form_state'] = $form_state;

      $batch['progressive'] = !$form_state->isProgrammed();
      $response = batch_process();
      // If the batch has been completed and _batch_finished() called then
      // $batch will be NULL.
      if ($batch && $batch['progressive']) {
        return $response;
      }

      // Execution continues only for programmatic forms.
      // For 'regular' forms, we get redirected to the batch processing
      // page. Form redirection will be handled in _batch_finished(),
      // after the batch is processed.
    }

    // Set a flag to indicate the form has been processed and executed.
    $form_state->setExecuted();

    // If no response has been set, process the form redirect.
    if (!$form_state->getResponse() && $redirect = $this->redirectForm($form_state)) {
      $form_state->setResponse($redirect);
    }

Seems the eca Form submit handler produces an empty response for the form which triggers the redirect.

Steps to reproduce

  1. install entity browser module (https://www.drupal.org/project/entity_browser) and create an entity browser with two widgets.
  2. use entity browser in a node form
  3. entity browser can switch widget
  4. install ECA and ECA Form
  5. switching widget in entity browser is not possible. developer console network inspector shows a 303 redirect to default widget
Edited by drupalbot
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information