Ajax POST forms without destination throw BrokenPostRequestException

Created on 24 April 2024, about 2 months ago

Problem/Motivation

After the commit of πŸ› Form Builder does not fully allow Ajax GET requests Fixed , some forms in our setup are broken and lead to BrokenPostRequestException after submission.

This happens if the the form gets submitted via Ajax using POST and the destination is the form itself.
In such a case the URL changes from /foo to /foo?ajax_form=1&_wrapper_format=drupal_ajax.
I assume that these parameters cause the form_builder to set $ajax_form_request to TRUE when building the form. But now the current method isn't POST anymore but GET because of the redirect after submission.

Proposed resolution

I created a patch that solves the issue for us by limiting the check for an incomplete post to the method POST.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
AjaxΒ  β†’

Last updated 1 day ago

Created by

πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024