Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make compat with sf5.0 form and parameter type declarations in conjun… #169

Merged
merged 6 commits into from
Nov 22, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/EventListener/ResizeFormListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function preSetData(FormEvent $event): void

// First remove all rows except for the prototype row
foreach ($form as $name => $child) {
$form->remove($name);
$form->remove((string)$name);
phiamo marked this conversation as resolved.
Show resolved Hide resolved
}

// Then add all rows again in the correct order
Expand Down Expand Up @@ -130,12 +130,12 @@ public function preSubmit(FormEvent $event): void

// Remove all empty rows except for the prototype row
foreach ($form as $name => $child) {
$form->remove($name);
$form->remove((string)$name);
phiamo marked this conversation as resolved.
Show resolved Hide resolved
}

// Add all additional rows
foreach ($data as $name => $value) {
if (!$form->has($name)) {
if (!$form->has((string)$name)) {
phiamo marked this conversation as resolved.
Show resolved Hide resolved
$buildOptions = [
'property_path' => '['.$name.']',
];
Expand Down Expand Up @@ -176,7 +176,7 @@ public function onSubmit(FormEvent $event): void
}

foreach ($data as $name => $child) {
if (!$form->has($name)) {
if (!$form->has((string)$name)) {
phiamo marked this conversation as resolved.
Show resolved Hide resolved
unset($data[$name]);
}
}
Expand Down