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
126
126
127
127
public function getFormValues (): array
128
128
{
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 ?? []);
134
130
}
135
131
136
132
private function submitForm (bool $ validateAll = true ): void
@@ -161,14 +157,17 @@ private function submitForm(bool $validateAll = true): void
161
157
* frontend, and it's meant to equal the raw POST data that would
162
158
* be sent if the form were submitted without modification.
163
159
*/
164
- private function extractFormValues (FormView $ formView ): array
160
+ private function extractFormValues (FormView $ formView, array $ values = [] ): array
165
161
{
166
- $ values = [];
167
162
foreach ($ formView ->children as $ child ) {
168
163
$ name = $ child ->vars ['name ' ];
169
164
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
+ }
171
169
170
+ if (null !== ($ values [$ name ] ?? null )) {
172
171
continue ;
173
172
}
174
173
You can’t perform that action at this time.
0 commit comments