Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[Form] Do not ignore the choice groups for caching #29695
While working on a different issue I suddenly came over a strange behaviour.
$builder ->add('choice1', ChoiceType::class, [ 'choices' => [ 'a' => 'a', 'b' => 'b', 'c' => 'c', ], 'multiple' => true, ]) ->add('choice2', ChoiceType::class, [ 'choices' => [ 'ab' => [ 'a' => 'a', 'b' => 'b', ], 'c' => 'c', ], 'multiple' => true, ]);
The code above will result in two identical selects:
The reason for this is hash generation in
The comment says that the same choice list should be returned for the same collection of choices no matter the structure. This is wrong, because
I propose a simple change that fixes this and allows for similar choice fields with different groupings.