Closed
Description
Seems like this issue is related to #15544
class PhotoType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('title', TextType::class);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => Photo::class,
'required' => false
]);
}
}
Actual result:
<input type="text" id="news_photos___name___title" name="news[photos][__name__][title]" required="required" class="form-control" />
Prototype is rendered with the "required" option. The explanation of this behavior is given in the comment #15544 (comment)
Is it possible to fix it?