Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] The HttpFoundationRequestHandler class is not compatible with some form usages #750

Open
Nek- opened this issue Oct 17, 2023 · 0 comments

Comments

@Nek-
Copy link

Nek- commented Oct 17, 2023

Sylius version affected: all

Description

Some standard usage of the form component of Symfony leads to issues with the HttpFoundationRequestHandler.php provided by the bundle.

This part of the code seems to be the issue:

// Don't submit GET requests if the form's name does not exist
// in the request
if (!$request->query->has($name)) {
return;
}

Steps to reproduce

Consider I want to validate an input using a form and validator for a simple input (in this example, to access URL foo/bar?search=something). I can do this with Symfony:

        $form = $this->formFactory->createNamedBuilder('search', EntityType::class, null, [
            'method' => 'GET',
            'constraints' => [new NotNull(), new CustomValidation()],
            'class' => Retailer::class,
            'csrf_protection' => false,
        ])->getForm();

It's not working with the SyliusResourceBundle activated.

Possible Solution

Remove the class that overrides Symfony behavior? (I've no idea what it fixes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant