Skip to content

[HttpFoundation][Form] HttpFoundationRequestHandler form and request method mismatch #8011

@kor3k

Description

@kor3k

there is a problem in Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler
lines 38-42

    $method = $form->getConfig()->getMethod();

    if ($method !== $request->getMethod()) {
        return;
    } 

i use the same form and it's creating process for POST, PUT, PATCH. i set the method in the template like this:

form_start( form , {'method': 'POST' , 'action': url( 'post_resource' ) })

when the method is PUT or PATCH (other than the one in form's config, which is default, ie POST), then the check on line 40 fails with no verbal error.

why is this check&return here anyway? i don't see any point in it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions