Sonataadminbundle: compatibility error with symfony 4

Created on 25 Aug 2018  Â·  9Comments  Â·  Source: sonata-project/SonataAdminBundle

symfony/class-loader minimal version for symfony 4 is 3.4 and max version for sonata is 3.2.

Alter sonata to use max 3.4

bug

Most helpful comment

Thanks,

Good Morning

But composer.json of SonataAdminBundle require this componente, and composer conflite in instalation with symfony 4 website-skeleton.

How I can do?

Commands

• composer create-project symfony/website-skeleton event
• cd event
• composer require sonata-project/admin-bundle

Messages

Problem 1
- sonata-project/admin-bundle 3.38.3 requires symfony/class-loader ^2.8 || ^3.2 -> satisfiable by symfony/class-loader[3.4.x-dev] but these conflict with your requirements or minimum-stability.
- sonata-project/admin-bundle 3.38.2 requires symfony/class-loader ^2.8 || ^3.2 -> satisfiable by symfony/class-loader[3.4.x-dev] but these conflict with your requirements or minimum-stability.
- sonata-project/admin-bundle 3.38.1 requires symfony/class-loader ^2.8 || ^3.2 -> satisfiable by symfony/class-loader[3.4.x-dev] but these conflict with your requirements or minimum-stability.
- sonata-project/admin-bundle 3.38.0 requires symfony/class-loader ^2.8 || ^3.2 -> satisfiable by symfony/class-loader[3.4.x-dev] but these conflict with your requirements or minimum-stability.
- Installation request for sonata-project/admin-bundle ^3.38 -> satisfiable by sonata-project/admin-bundle[3.38.0, 3.38.1, 3.38.2, 3.38.3].

All 9 comments

Class loader was deprecated and removed in Symfony 4, shouldn’t be used anymore. This has nothing to do with Symfony 4 compatibility.

Thanks,

Good Morning

But composer.json of SonataAdminBundle require this componente, and composer conflite in instalation with symfony 4 website-skeleton.

How I can do?

Commands

• composer create-project symfony/website-skeleton event
• cd event
• composer require sonata-project/admin-bundle

Messages

Problem 1
- sonata-project/admin-bundle 3.38.3 requires symfony/class-loader ^2.8 || ^3.2 -> satisfiable by symfony/class-loader[3.4.x-dev] but these conflict with your requirements or minimum-stability.
- sonata-project/admin-bundle 3.38.2 requires symfony/class-loader ^2.8 || ^3.2 -> satisfiable by symfony/class-loader[3.4.x-dev] but these conflict with your requirements or minimum-stability.
- sonata-project/admin-bundle 3.38.1 requires symfony/class-loader ^2.8 || ^3.2 -> satisfiable by symfony/class-loader[3.4.x-dev] but these conflict with your requirements or minimum-stability.
- sonata-project/admin-bundle 3.38.0 requires symfony/class-loader ^2.8 || ^3.2 -> satisfiable by symfony/class-loader[3.4.x-dev] but these conflict with your requirements or minimum-stability.
- Installation request for sonata-project/admin-bundle ^3.38 -> satisfiable by sonata-project/admin-bundle[3.38.0, 3.38.1, 3.38.2, 3.38.3].

I'm having the exact same problem. sonata-project/admin-bundle is still requiring symfony/class-loader in its composer.json file,.

This dependency causes installation to fail with Symfony 4.x. The problem can be reproduced by following the commands @fcordeiro6 used above:

composer create-project symfony/website-skeleton <some project name>
cd <some project name>
composer require sonata-project/admin-bundle

Note that this is a completely clean install of Symfony 4.x and uses the default configuration.

This also fails if you specify 4.x-dev because the master branch still lists symfony/class-loader as a dependency:

https://github.com/sonata-project/SonataAdminBundle/blob/2cdfe006dccbd3f7361cf5e85236335e7ee9d323/composer.json#L33

A workaround to this problem seems to be to manually require symfony/class-loader:

composer require symfony/class-loader 3.4.x-dev

Not exactly a good solution since it's using deprecated code.

I just tested and you are correct, when did this go wrong is the question 🤔 Last week it worked.

In Symfony stable version 4.1.3. Until 4.1.2 no problems, last week ;).

NeuralClone the workaround is functional. But one correction is necessery.

@fcordeiro6 @NeuralClone @wmsamolet @ihateito @webeith @garak can someone test if #5217 fixes your problem.

@kunicmarko20: It appears that #5217 fixes the problem for me. I haven't been able to reproduce this bug locally once applying the patch. Thank you for working to try to fix this so quickly!

@fcordeiro6: Good to know! Although I'm a little confused. What correction are you referring to? 3.4.x-dev is the only way to satisfy the requirements unless I'm missing something obvious.

Was this page helpful?
0 / 5 - 0 ratings