-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration with non bundled mapping and xml mapping is broken in 5.0 #841
Comments
I confirm i have the same problem when i try to update symfony 6.4 to 7.0 with the update of this bundle |
Thanks for the reminder, I'm checking. |
We use But the |
The issue is caused by #821 |
…rineExtension (GromNaN) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [DoctrineBridge] Fix detection of Xml/Yaml driver in DoctrineExtension | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix doctrine/DoctrineMongoDBBundle#841 | License | MIT In DoctrineMongoDBBundle v5, we removed `.class` attributes to plain class names in service definitions (see doctrine/DoctrineMongoDBBundle#821). The class for `doctrine_mongodb.odm.default_xml_metadata_driver` changed from `doctrine_mongodb.odm.metadata.xml.class` to `Doctrine\Bundle\MongoDBBundle\Mapping\Driver\XmlDriver`. I fixed the detection of the driver by checking the uppercase `Xml` and `Yaml` because it might be necessary if the same change is made to DoctrineBundle. [`doctrine/mongodb-odm-bundle` requires `symfony/doctrine-bridge: "^6.4 || ^7.0"`](https://github.com/doctrine/DoctrineMongoDBBundle/blob/4d8d32b726e7af21a562a2b6a227f0496c7d39d5/composer.json#L36) so this patch if not required for older versions of Symfony even if it could be applied. Commits ------- 662b8f2 [DoctrineBridge] Fix detection of Xml/Yaml driver in DoctrineExtension
Hi,
I have a project, with persisted document are not in bundle and use a xml mapping.
The configuration is
It's work with the bundle under v4.7 (With Symfony 6.4 or 7.0) but not with v5.0
I have this error :
PHP Fatal error: Uncaught TypeError: is_dir(): Argument #1 ($filename) must be of type string, int given in /home/richard/Prog/teknoo/websites/website-deloge-io/appliance/vendor/doctrine/persistence/src/Persistence/Mapping/Driver/SymfonyFileLocator.php:180
After debug, the compiled DI for the document manager is different, The error come from the XmlDriver configuration and the Symfony DoctrineBridge and this bunde.
With 4.7, the generated code is :
But with 5.0
$c = new \Doctrine\Bundle\MongoDBBundle\Mapping\Driver\XmlDriver([(\dirname(__DIR__, 4).'/vendor/teknoo/east-common/infrastructures/doctrine/config/universal'), (\dirname(__DIR__, 4).'/vendor/teknoo/east-common/infrastructures/doctrine/config/doctrine'), (\dirname(__DIR__, 4).'/vendor/teknoo/east-website/infrastructures/doctrine/config/universal'), (\dirname(__DIR__, 4).'/vendor/teknoo/east-website/infrastructures/doctrine/config/doctrine')]);
The first argument of XmlDriver has only array's values wihout keys.
It come from the 'vendor/symfony/doctrine-bridge/DependencyInjection/AbstractDoctrineExtension.php', line 218
The mappingDriverDef->getClass() return
%doctrine_mongodb.odm.metadata.xml.class%
and the condition will be trueBut it 5.0
Doctrine\Bundle\MongoDBBundle\Mapping\Driver\XmlDriver
and because the condition is sensible to the case, it will never be true.Thanks.
The text was updated successfully, but these errors were encountered: