Closed
Description
A form created like this will result in an extra data error
$form = $this->get('form.factory')
->createNamed('',
ArticleType::class,
$article,
[
'action' => $this->generateUrl(
'article_update',
[
'article' => $article->getId()
]
),
'method' => 'PUT',
]
);
It seems that the RequestHandler will submit the form with all request parameters in case of an empty form name (which includes the hidden _method field)
if ('' === $name) {
$params = $request->request->all();
$files = $request->files->all();
}
The submit method of the Form doesn't seem to do any particular check for that special parameter.
A workaround is to set allow_extra_fields to true in the form