diff --git a/core/lib/Drupal/Core/Form/FormBuilder.php b/core/lib/Drupal/Core/Form/FormBuilder.php
index bb7034f..007893d 100644
--- a/core/lib/Drupal/Core/Form/FormBuilder.php
+++ b/core/lib/Drupal/Core/Form/FormBuilder.php
@@ -321,7 +321,9 @@ public function buildForm($form_id, FormStateInterface &$form_state) {
     // In case the post request exceeds the configured allowed size
     // (post_max_size), the post request is potentially broken. Add some
     // protection against that and at the same time have a nice error message.
-    if ($ajax_form_request && !isset($form_state->getUserInput()['form_id'])) {
+    file_put_contents('/tmp/form_id.txt', print_r($request->request->has('form_id'), 1), FILE_APPEND);
+    if ($ajax_form_request && !$request->request->has('form_id')) {
+    file_put_contents('/tmp/broken.txt', print_r($request->request->has('form_id'), 1), FILE_APPEND);
       throw new BrokenPostRequestException($this->getFileUploadMaxSize());
     }
 
@@ -332,7 +334,7 @@ public function buildForm($form_id, FormStateInterface &$form_state) {
     // then passed through
     // \Drupal\Core\Form\FormAjaxResponseBuilderInterface::buildResponse() to
     // build a proper AJAX response.
-    if ($ajax_form_request && $form_state->isProcessingInput()) {
+    if ($ajax_form_request && $form_state->isProcessingInput() && $request->request->get('form_id') == $form_id) {
       throw new FormAjaxException($form, $form_state);
     }
 
