Skip to content

Commit

Permalink
bug #9443 [FrameworkBundle] Fixed the registration of validation.xml …
Browse files Browse the repository at this point in the history
…file when the form is disabled (hason)

This PR was submitted for the 2.1 branch but it was merged into the 2.2 branch instead (closes #9443).

Discussion
----------

[FrameworkBundle] Fixed the registration of validation.xml file when the form is disabled

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

cfa5aa5 [FrameworkBundle] Fixed the registration of validation.xml file when the form is disabled
  • Loading branch information
fabpot committed Nov 28, 2013
2 parents be0a310 + d0c1db8 commit 3aa4e14
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -624,9 +624,13 @@ private function registerValidationConfiguration(array $config, ContainerBuilder

private function getValidatorXmlMappingFiles(ContainerBuilder $container)
{
$reflClass = new \ReflectionClass('Symfony\Component\Form\FormInterface');
$files = array(dirname($reflClass->getFileName()).'/Resources/config/validation.xml');
$container->addResource(new FileResource($files[0]));
$files = array();

if (interface_exists('Symfony\Component\Form\FormInterface')) {
$reflClass = new \ReflectionClass('Symfony\Component\Form\FormInterface');
$files[] = dirname($reflClass->getFileName()).'/Resources/config/validation.xml';
$container->addResource(new FileResource($files[0]));
}

foreach ($container->getParameter('kernel.bundles') as $bundle) {
$reflection = new \ReflectionClass($bundle);
Expand Down

0 comments on commit 3aa4e14

Please sign in to comment.