Skip to content

Commit fad2c31

Browse files
authored
Create form type for content element only if it doesn't exist (#121)
| Q | A | --------------- | ----- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no<!-- don't forget to update UPGRADE-*.md file --> | Related tickets | #111 | License | MIT
2 parents 07c4604 + 3eb0f47 commit fad2c31

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/DependencyInjection/Compiler/ContentElementPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function process(ContainerBuilder $container): void
3333
$definition->addMethodCall('setTemplate', [$attributes[0]['template']]);
3434
$definition->addMethodCall('setTwigEnvironment', [new Reference('twig')]);
3535

36-
if (isset($attributes[0]['form_type'])) {
36+
if (isset($attributes[0]['form_type']) && !$container->hasDefinition($attributes[0]['form_type'])) {
3737
$this->registerFormTypeService($container, $attributes[0]['form_type']);
3838
}
3939
}

0 commit comments

Comments
 (0)