Skip to content

Commit

Permalink
Merge pull request #26 from ThePolkaDotRook/master
Browse files Browse the repository at this point in the history
Avoid unknown field error during initial values normalization when csrf_protection is true
  • Loading branch information
nacmartin committed Dec 6, 2018
2 parents d314437 + a026192 commit b46ba76
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ private function getValues(Form $form, FormView $formView)
if (empty($child->children) && ($child->vars['value'] === null || $child->vars['value'] === '')) {
continue;
}
$data->{$name} = $this->getValues($form[$name], $child);

// Avoid unknown field error when csrf_protection is true
// CSRF token should be extracted another way
if ($form->has($name)) {
$data->{$name} = $this->getValues($form->get($name), $child);

This comment has been minimized.

Copy link
@stevanradovanovic

stevanradovanovic Jan 21, 2019

@nacmartin, what is the another way to extract CSRF?

Can we add something like this $data->{$name} = $child->vars['value'] and collect token here as well? Thanks!

}
}

return $data;
Expand Down

0 comments on commit b46ba76

Please sign in to comment.