File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -126,11 +126,7 @@ public function getFormName(): string
126126
127127 public function getFormValues (): array
128128 {
129- if (null === $ this ->formValues ) {
130- $ this ->formValues = $ this ->extractFormValues ($ this ->getForm ());
131- }
132-
133- return $ this ->formValues ;
129+ return $ this ->formValues = $ this ->extractFormValues ($ this ->getForm (), $ this ->formValues ?? []);
134130 }
135131
136132 private function submitForm (bool $ validateAll = true ): void
@@ -161,14 +157,17 @@ private function submitForm(bool $validateAll = true): void
161157 * frontend, and it's meant to equal the raw POST data that would
162158 * be sent if the form were submitted without modification.
163159 */
164- private function extractFormValues (FormView $ formView ): array
160+ private function extractFormValues (FormView $ formView, array $ values = [] ): array
165161 {
166- $ values = [];
167162 foreach ($ formView ->children as $ child ) {
168163 $ name = $ child ->vars ['name ' ];
169164 if (!($ child ->vars ['expanded ' ] ?? false ) && \count ($ child ->children ) > 0 ) {
170- $ values [$ name ] = $ this ->extractFormValues ($ child );
165+ $ values [$ name ] = $ this ->extractFormValues ($ child , $ values [$ name ]);
166+
167+ continue ;
168+ }
171169
170+ if (null !== ($ values [$ name ] ?? null )) {
172171 continue ;
173172 }
174173
You can’t perform that action at this time.
0 commit comments