Fosuserbundle: Problem with Symfony 4.4.0 TWIG

Created on 30 Nov 2019  路  8Comments  路  Source: FriendsOfSymfony/FOSUserBundle

Code: composer require friendsofsymfony/user-bundle "~2.0"
Result:
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.4.*"
Your requirements could not be resolved to an installable set of packages.

Problem 1
- friendsofsymfony/user-bundle v2.1.2 requires twig/twig ^1.28 || ^2.0 -> satisfiable by twig/twig[1.x-dev, 2.x-dev, v1.28.0, v1.28.1, v1.28.2, v1.29.0, v1.30.0, v1.31.0, v1.32.0, v1.33.0, v1.33.1, v1.33.2, v1.34.0, v1.34.1, v1.34.2, v1.34.3, v1.34.4, v1.35.0, v1.35.1, v1.35.2, v1.35.3, v1.35.4, v1.36.0, v1.37.0, v1.37.1, v1.38.0, v1.38.1, v1.38.2, v1.38.3, v1.38.4, v1.39.0, v1.39.1, v1.40.0, v1.40.1, v1.41.0, v1.42.0, v1.42.1, v1.42.2, v1.42.3, v1.42.4, v2.0.0, v2.1.0, v2.10.0, v2.11.0, v2.11.1, v2.11.2, v2.11.3, v2.12.0, v2.12.1, v2.12.2, v2.2.0, v2.3.0, v2.3.1, v2.3.2, v2.4.0, v2.4.1, v2.4.2, v2.4.3, v2.4.4, v2.4.5, v2.4.6, v2.4.7, v2.4.8, v2.5.0, v2.6.0, v2.6.1, v2.6.2, v2.7.0, v2.7.1, v2.7.2, v2.7.3, v2.7.4, v2.8.0, v2.8.1, v2.9.0] but these conflict with your requirements or minimum-stability.
- friendsofsymfony/user-bundle v2.1.1 requires twig/twig ^1.28 || ^2.0 -> satisfiable by twig/twig[1.x-dev, 2.x-dev, v1.28.0, v1.28.1, v1.28.2, v1.29.0, v1.30.0, v1.31.0, v1.32.0, v1.33.0, v1.33.1, v1.33.2, v1.34.0, v1.34.1, v1.34.2, v1.34.3, v1.34.4, v1.35.0, v1.35.1, v1.35.2, v1.35.3, v1.35.4, v1.36.0, v1.37.0, v1.37.1, v1.38.0, v1.38.1, v1.38.2, v1.38.3, v1.38.4, v1.39.0, v1.39.1, v1.40.0, v1.40.1, v1.41.0, v1.42.0, v1.42.1, v1.42.2, v1.42.3, v1.42.4, v2.0.0, v2.1.0, v2.10.0, v2.11.0, v2.11.1, v2.11.2, v2.11.3, v2.12.0, v2.12.1, v2.12.2, v2.2.0, v2.3.0, v2.3.1, v2.3.2, v2.4.0, v2.4.1, v2.4.2, v2.4.3, v2.4.4, v2.4.5, v2.4.6, v2.4.7, v2.4.8, v2.5.0, v2.6.0, v2.6.1, v2.6.2, v2.7.0, v2.7.1, v2.7.2, v2.7.3, v2.7.4, v2.8.0, v2.8.1, v2.9.0] but these conflict with your requirements or minimum-stability.
- friendsofsymfony/user-bundle v2.1.0 requires twig/twig ^1.28 || ^2.0 -> satisfiable by twig/twig[1.x-dev, 2.x-dev, v1.28.0, v1.28.1, v1.28.2, v1.29.0, v1.30.0, v1.31.0, v1.32.0, v1.33.0, v1.33.1, v1.33.2, v1.34.0, v1.34.1, v1.34.2, v1.34.3, v1.34.4, v1.35.0, v1.35.1, v1.35.2, v1.35.3, v1.35.4, v1.36.0, v1.37.0, v1.37.1, v1.38.0, v1.38.1, v1.38.2, v1.38.3, v1.38.4, v1.39.0, v1.39.1, v1.40.0, v1.40.1, v1.41.0, v1.42.0, v1.42.1, v1.42.2, v1.42.3, v1.42.4, v2.0.0, v2.1.0, v2.10.0, v2.11.0, v2.11.1, v2.11.2, v2.11.3, v2.12.0, v2.12.1, v2.12.2, v2.2.0, v2.3.0, v2.3.1, v2.3.2, v2.4.0, v2.4.1, v2.4.2, v2.4.3, v2.4.4, v2.4.5, v2.4.6, v2.4.7, v2.4.8, v2.5.0, v2.6.0, v2.6.1, v2.6.2, v2.7.0, v2.7.1, v2.7.2, v2.7.3, v2.7.4, v2.8.0, v2.8.1, v2.9.0] but these conflict with your requirements or minimum-stability.
- friendsofsymfony/user-bundle v2.0.2 requires symfony/form ^2.7 || ^3.0 -> no matching package found.
- friendsofsymfony/user-bundle v2.0.1 requires symfony/form ^2.7 || ^3.0 -> no matching package found.
- friendsofsymfony/user-bundle v2.0.0 requires symfony/form ^2.7 || ^3.0 -> no matching package found.
- Installation request for friendsofsymfony/user-bundle ~2.0 -> satisfiable by friendsofsymfony/user-bundle[v2.0.0, v2.0.1, v2.0.2, v2.1.0, v2.1.1, v2.1.2].

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

Installation failed, reverting ./composer.json to its original content.

What should I do with that?

Most helpful comment

Yes, it's actually quite easy to use it in a Symfony 4.4 project with twig 3.0, like others stated you need to downgrade twig to 2.x. So it won't work if you have other packages requiring twig 3 specifically.

Steps

  1. Add --no-update to the composer require command, something like composer require friendsofsymfony/user-bundle "~2.0" --no-update.
  2. Run composer update and let composer figure out the dependencies and downgrade twig from 3.x to 2.x

This way it'll automatically upgrade back to Twig 3 once compatibility issues are solved.

If you still get dependency errors then some other bundle may require 3.x specifically or not work with 2.x use composer why twig/twig to find out which page doesn't work on 2.x

The above was tested and works with a clean install of Symfony 4.4 using the website skeleton (meaning symfony/twig-pack was used as well)

All 8 comments

What's your twig/twig version?

Same problem here, twig/twig is v3.0.0. Should I downgrade to ^2.9

For now yes. This bundle has not been upgraded to support Twig 3 (that should be easy though, so PRs are welcome as well).

I've the same problem but i've not twig/twig on my composer.json.
I've symfony/twig-pack:"*".

So, is it possible to install FOSUserBundle on SF 4.4 project ?

Yes, it's actually quite easy to use it in a Symfony 4.4 project with twig 3.0, like others stated you need to downgrade twig to 2.x. So it won't work if you have other packages requiring twig 3 specifically.

Steps

  1. Add --no-update to the composer require command, something like composer require friendsofsymfony/user-bundle "~2.0" --no-update.
  2. Run composer update and let composer figure out the dependencies and downgrade twig from 3.x to 2.x

This way it'll automatically upgrade back to Twig 3 once compatibility issues are solved.

If you still get dependency errors then some other bundle may require 3.x specifically or not work with 2.x use composer why twig/twig to find out which page doesn't work on 2.x

The above was tested and works with a clean install of Symfony 4.4 using the website skeleton (meaning symfony/twig-pack was used as well)

For now yes. This bundle has not been upgraded to support Twig 3 (that should be easy though, so PRs are welcome as well).

When this bundle will be upgraded to support S4.4 (Twig 3) ....

Hi,

I am wondering if there is any update on when the FOSUserBundle will support Twig 3. I'm not entirely against downgrading to Twig 2.14, but i'd rather not get stuck on an older dependency if I can avoid it.

@stof mentioned it should be easy enough to upgrade - has anyone made a start on this since it was reported?

Cheers.

For now yes. This bundle has not been upgraded to support Twig 3 (that should be easy though, so PRs are welcome as well).

Bonjour,

I feel silly asking this, but I've given a try just changing the composer.json file to support Twig 3.0 and, so far, I haven't seen anything breaking. Is it possible this is all that's needed? Otherwise, some pointers towards areas to test would be welcome.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tinntsea picture tinntsea  路  5Comments

pmpr-ir picture pmpr-ir  路  3Comments

sinner picture sinner  路  3Comments

karimdev picture karimdev  路  4Comments

nkl90 picture nkl90  路  6Comments