doctrine / DoctrineMongoDBBundle

Integrates Doctrine MongoDB ODM with Symfony
http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html
MIT License
377 stars 231 forks source link

Non-existent service after fresh installation on branch 5.0.x #830

Closed michaelthieulin closed 6 months ago

michaelthieulin commented 6 months ago

Environment :

When I install a fresh version of Symfony with the symfony cli :

symfony new test --webapp --version="stable"

Then, i add the DoctrineMongoDBBundle :

composer require doctrine/mongodb-odm-bundle:5.0.x-dev

Then I answer yes for the recipe execution.

I have the following error while the execution of the @auto-scripts part of composer.json, more precisely in the cache:clear command :

The service "doctrine_mongodb.odm.command.load_data_fixtures" has a dependency on a non-existent service "doctrine_mongodb.odm.symfony.fixtures.loader".

I managed to fix this by installing doctrine/data-fixtures but I don't want to have this package in prod environment.

After accessing the page http://127.0.0.1:8000/ after launching symfony serve in the test directory, I have the following error :

The profiler template "@DoctrineMongoDB/Collector/mongodb.html.twig" for data collector "mongodb" does not exist.

Thanks and mainly thanks for the hard work.

GromNaN commented 6 months ago

I'm on it. Thanks for the report.

MatTheCat commented 6 months ago

Just hit this one; $container->removeDefinition(LoadDataFixturesDoctrineODMCommand::class); should be $container->removeDefinition('doctrine_mongodb.odm.command.load_data_fixtures'); in the DoctrineMongoDBExtension.

franmomu commented 6 months ago

That was my fault in https://github.com/doctrine/DoctrineMongoDBBundle/pull/810 that I added ids based on the best practices, but forgot to search usages.

MatTheCat commented 6 months ago

@michaelthieulin maybe you should create another issue regarding the profiler template?

michaelthieulin commented 6 months ago

Thanks for the ultra speed fix 🤣 I open another issue for the template.

GromNaN commented 6 months ago

I'm looking at the template issue.

GromNaN commented 6 months ago

Template issue fix: https://github.com/doctrine/DoctrineMongoDBBundle/pull/833