Sylius/SyliusResourceBundle

Submitting form using GET method with non-scalar parameters

mpysiak opened this issue · 0 comments

Sylius version affected: 1.10.0

Description
Due to Symfony deprecation mentioned in #335:

User Deprecated: Since symfony/http-foundation 5.1: Retrieving a non-string value from "Symfony\Component\HttpFoundation\InputBag::get()" is deprecated, and will throw a "Symfony\Component\HttpFoundation\Exception\BadRequestException" exception in Symfony 6.0, use "Symfony\Component\HttpFoundation\InputBag::all($key)" instead.

using Symfony Form (with GET method) with non-scalar parameters will throw an Exception in Symfony 6.
Form example: https://github.com/BitBagCommerce/SyliusElasticsearchPlugin/blob/master/src/Form/Type/SearchType.php

When I try to submit this form:
Screenshot 2022-11-28 at 20 36 10

In Symfony 5.4 same form works perfectly.

Steps to reproduce
Try to submit Form from the example above or create any form with array parameters using GET method.

Possible Solution

should be:

$data = $request->query->all()[$name];