From f216ebc8260b937c067958968794522fbb0fb068 Mon Sep 17 00:00:00 2001 From: nixls <28026071+nixls@users.noreply.github.com> Date: Thu, 28 Mar 2024 12:58:44 +0100 Subject: [PATCH 1/2] Fix infinite loop in validation group collection --- src/Form/Type/TermsCheckboxCollectionType.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Form/Type/TermsCheckboxCollectionType.php b/src/Form/Type/TermsCheckboxCollectionType.php index 853b9ba..5876ea5 100644 --- a/src/Form/Type/TermsCheckboxCollectionType.php +++ b/src/Form/Type/TermsCheckboxCollectionType.php @@ -32,11 +32,11 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $validationGroups = []; while (null !== $parent) { $groups = $parent->getConfig()->getOption('validation_groups'); - if (!is_array($groups)) { - continue; + + if (is_array($groups)) { + $validationGroups[] = $groups; } - $validationGroups[] = $groups; $parent = $parent->getParent(); } From 0e6752efa07db31326102e58a3f437e8aa795c59 Mon Sep 17 00:00:00 2001 From: nixls <28026071+nixls@users.noreply.github.com> Date: Thu, 28 Mar 2024 13:01:21 +0100 Subject: [PATCH 2/2] format --- src/Form/Type/TermsCheckboxCollectionType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Form/Type/TermsCheckboxCollectionType.php b/src/Form/Type/TermsCheckboxCollectionType.php index 5876ea5..1456134 100644 --- a/src/Form/Type/TermsCheckboxCollectionType.php +++ b/src/Form/Type/TermsCheckboxCollectionType.php @@ -34,7 +34,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $groups = $parent->getConfig()->getOption('validation_groups'); if (is_array($groups)) { - $validationGroups[] = $groups; + $validationGroups[] = $groups; } $parent = $parent->getParent();