Im changing some fields via AJAX and when im trying to save a form i recive a error that Extra fields are not allowed
.
How to change that validator property like validatorPass()
in sf1.4 ?
Or its possible change to form to accept extra fields ?
Im using SonataAdminBundle to create forms.
You could remove the extra fields from the request data before binding them to the form:
// The JSON PUT data will include all attributes in the entity, even
// those that are not updateable by the user and are not in the form.
// We need to remove these extra fields or we will get a
// "This form should not contain extra fields" Form Error
$data = $request->request->all();
$children = $form->all();
$data = array_intersect_key($data, $children);
$form->bind($data);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With