Skip to content

Commit

Permalink
Fixed the registration of validation.xml file when the form is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
hason authored and fabpot committed Nov 28, 2013
1 parent be0a310 commit d0c1db8
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 d0c1db8

Please sign in to comment.