Skip to content

Commit

Permalink
bug #58834 [FrameworkBundle] ensure validator.translation_domain pa…
Browse files Browse the repository at this point in the history
…rameter is always set (xabbuh)

This PR was merged into the 7.2 branch.

Discussion
----------

[FrameworkBundle] ensure `validator.translation_domain` parameter is always set

| Q             | A
| ------------- | ---
| Branch?       | 7.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #58833
| License       | MIT

Commits
-------

67d0854 ensure that the validator.translation_domain parameter is always set
  • Loading branch information
nicolas-grekas committed Nov 13, 2024
2 parents dbacea3 + 67d0854 commit aef53e9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ public function load(array $configs, ContainerBuilder $container): void
throw new \LogicException('Requiring the "symfony/symfony" package is unsupported; replace it with standalone components instead.');
}

if (!ContainerBuilder::willBeAvailable('symfony/validator', Validation::class, ['symfony/framework-bundle', 'symfony/form'])) {
$container->setParameter('validator.translation_domain', 'validators');
}

$loader->load('web.php');
$loader->load('services.php');
$loader->load('fragment_renderer.php');
Expand Down Expand Up @@ -479,8 +483,6 @@ public function load(array $configs, ContainerBuilder $container): void
if (ContainerBuilder::willBeAvailable('symfony/validator', Validation::class, ['symfony/framework-bundle', 'symfony/form'])) {
$this->writeConfigEnabled('validation', true, $config['validation']);
} else {
$container->setParameter('validator.translation_domain', 'validators');

$container->removeDefinition('form.type_extension.form.validator');
$container->removeDefinition('form.type_guesser.validator');
}
Expand Down

0 comments on commit aef53e9

Please sign in to comment.