Commit 2fe1c71
committed
bug symfony#52606 [DoctrineBridge] Fix use "attribute" driver by default (vtsykun)
This PR was merged into the 7.0 branch.
Discussion
----------
[DoctrineBridge] Fix use "attribute" driver by default
| Q | A
| ------------- | ---
| Branch? | 7.0
| Bug fix? | yes
| New feature? | -
| Deprecations? | -
| Issues | -
| License | MIT
When I tested 7.0-RC1 version I noticed an error of detect doctrine driver type by default
```
In AbstractDoctrineExtension.php line 219:
[InvalidArgumentException]
Mapping definitions for Doctrine manager "default" require at least the "type", "dir" and "prefix" options.
Exception trace:
at /var/www/packeton5/vendor/symfony/doctrine-bridge/DependencyInjection/AbstractDoctrineExtension.php:219
Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension->assertValidMappingConfiguration() at /var/www/packeton5/vendor/symfony/doctrine-bridge/DependencyInjection/AbstractDoctrineExtension.php:97
Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension->loadMappingInformation() at /var/www/packeton5/vendor/doctrine/doctrine-bundle/DependencyInjection/DoctrineExtension.php:837
Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension->loadOrmEntityManagerMappingInformation() at /var/www/packeton5/vendor/doctrine/doctrine-bundle/DependencyInjection/DoctrineExtension.php:657
```
my config
```yaml
doctrine:
orm:
mappings:
Packeton:
is_bundle: false
dir: '%kernel.project_dir%/src/Entity'
prefix: 'Packeton\Entity'
alias: Packeton
```
Bug was introduced here https://github.com/symfony/symfony/pull/52142/files#diff-0f981a325d8c9eea80a258c36237861d1d00b0fb62fb04f2488bf2165776c94eR94
This conditions is never executed, because `$mappingConfig['type']` is false by default
```
$mappingConfig['type'] ??= 'attribute';
```

Commits
-------
44e9339 [DoctrineBridge] Fix use "attribute" driver by defaultFile tree
1 file changed
+2
-2
lines changed- src/Symfony/Bridge/Doctrine/DependencyInjection
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
0 commit comments