Open
Description
My form simplified:
// Prepare subform
$taco_test = $this->formBuilder->plain();
$taco_test->add('professions', 'choice', [
'label' => trans('report.taco_test.professions'),
'choices' => $favorites_options,
'multiple' => TRUE,
'expanded' => TRUE,
]);
// Add subform to parent
$this->add('taco_test', 'form', [
'label' => trans('report.taco_test.taco_test'),
'class' => $taco_test, // the plain form object
]);
So the checkboxes live at form.taco_test.professions
, so a single checkbox should be at eg. form.taco_test.professions.66
.
The resulting checkboxes have name="taco_test[professions][][]"
, with a double [][]
. Their values are correct.
I know the last []
are added in ChoiceType::buildCheckableChildren()
, but maybe it's the first []
that's actually wrong. I've no idea where that comes from.
I'm using 1.6.50 and I'm having some dependency problems, so I can't update in this context to try newer version, but the ChoiceType
code seems to be the same in HEAD.