Skip to content

Commit

Permalink
Disable validation groups on datagrid filter form
Browse files Browse the repository at this point in the history
Datagrid filters form data is passed as array, so it is validated with the Valid constraint (see https://symfony.com/doc/3.4/form/without_class.html#adding-validation)
Some errors related to linked objets, but unrelated to the form, can then appear in the filters block.
  • Loading branch information
Patrick BENOIT authored and core23 committed Dec 23, 2019
1 parent 36e01d4 commit ac1e9de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Builder/DatagridBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function getBaseDatagrid(AdminInterface $admin, array $values = [])

$pager->setCountColumn($admin->getModelManager()->getIdentifierFieldNames($admin->getClass()));

$defaultOptions = [];
$defaultOptions = ['validation_groups' => false];
if ($this->csrfTokenEnabled) {
$defaultOptions['csrf_protection'] = false;
}
Expand Down

0 comments on commit ac1e9de

Please sign in to comment.