Skip to content

Commit 5db9f0b

Browse files
committed
bug #6936 fix warning in ChoiceFilterType (bt-nn)
This PR was squashed before being merged into the 4.x branch. Discussion ---------- fix warning in ChoiceFilterType fixes #6935 <!-- Thanks for your contribution! If you are proposing a new feature that is complex, please open an issue first so we can discuss about it. Note: all your contributions adhere implicitly to the MIT license --> Commits ------- 43cdcca fix warning in ChoiceFilterType
2 parents 50aecbd + 43cdcca commit 5db9f0b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Form/Filter/Type/ChoiceFilterType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
2828
$builder->addModelTransformer(new CallbackTransformer(
2929
static fn ($data) => $data,
3030
static function ($data) use ($multiple) {
31+
// symfony form will cut off invalid values, so make sure no warnings will be thrown out:
32+
$data['value'] ??= null;
33+
3134
switch ($data['comparison']) {
3235
case ComparisonType::EQ:
3336
if (null === $data['value'] || ($multiple && 0 === \count($data['value']))) {

0 commit comments

Comments
 (0)