Sonataadminbundle: Compatibility with Symfony 4.4

Created on 21 Nov 2019  Â·  19Comments  Â·  Source: sonata-project/SonataAdminBundle

Having the application symfony/* components upgraded to 4.4.x causes application cache unusable.

Sonata:

        "sonata-project/admin-bundle": "~3.54.1",
        "sonata-project/classification-bundle": "~3.9.2",
        "sonata-project/exporter": "~2.0.1",
        "sonata-project/intl-bundle": "~2.7",
        "sonata-project/media-bundle": "~3.21.0",
        "sonata-project/doctrine-orm-admin-bundle": "~3.11.0",
        "sonata-project/user-bundle": "~4.5.1",

Steps:

  1. take a working application,
  2. change Symfony's package constraints to 4.4,
  3. composer update
  4. observe error: [php] Fatal Compile Error: Declaration of Sonata\Form\Validator\Constraints\InlineConstraint::__sleep() must be compatible with Symfony\Component\Validator\Constraint::__sleep(): array

I looked at form-extension and the signature is ok. But how should I replace CoreBundle with that library if there's a conflict within composer.json? What is an official upgrade path not to break Symfony?

Do I need to fix CoreBundle until the new major is being released?

bug

Most helpful comment

@core23 — any news? It's quite urgent because blocks applications from upgrade do Sf LTS.

All 19 comments

I think it's already fixed in 3.x branch of sonata-project/core-bundle (https://github.com/sonata-project/SonataCoreBundle/blob/4b4c65f7117cdeb54d19cc35b8bd0ef0aff5e37b/src/Form/Validator/Constraints/InlineConstraint.php#L52). Then this issue should then be opened on sonata-project/core-bundle to release a version compatible with SF4.4. WDYT @sonata-project/release-managers ?

Not in stable release, unfortunately.

@core23 can we create a release?

We can, but I'm not sure if this will work, because we have conflict entries for the extracted libs :/

Yup, but IMO you should fix this because of the constraints in composer.json.

The current release versions of various Sonata bundles require SonataCoreBundle, so a release of that including the fix that's already in master seems sensible to me, unless there's a blocker to doing that? As things stand, we're stuck with Symfony <4.4 if we want to use SonataAdminBundle.

@core23 — any news? It's quite urgent because blocks applications from upgrade do Sf LTS.

@core23 — any news? It's quite urgent because blocks applications from upgrade do Sf LTS.

I'm not activity working on this at the moment.

Btw. this is a symfony bug: https://github.com/symfony/symfony/issues/34478

You're right, we're waiting for merge and release.

Maybe we should add version contraints in our composer.json to blacklist buggy versions once https://github.com/symfony/symfony/pull/34513 is released? Or maybe even before?

It's hard to decide because the fix has been merged into the master yesterday and introducing blacklisting will create some kind of lag between two releases of Sonata…

I don't get it, sorry… what fix are you talking about? Can you share a link? If it's only available on sf master, I fail to see how this is going to help. Also, what do you mean by "some kind of lag". If 4.4.0 is buggy, we should blacklist it, period. I was wondering if this was going to be fixed in 4.4.1 or not, hence my question.

Ah, sorry, misunderstood.

BTW: https://github.com/symfony/symfony/pull/34513#issuecomment-558174683

Ok, that means we can and should blacklist 4.4.0. Can you please make a PR for this @er1z?

Also, is this really the right repo to report that issue? Your error message seems to say the bug occurs with a class from the core bundle or another, please check.

This issue should be fixed in Symfony 4.4.1.

This bug was fixed at symfony/symfony#34513 (which is already released on v4.4.1 and in v5.0.1) and sonata-project/SonataCoreBundle#716 (which is already released on v3.17.1).

I try to install on symfony 4.4.7 and having problem:
```

  • sonata-project/admin-bundle 3.65.0 requires sonata-project/core-bundle ^3.18.0 -> satisfiable by sonata-project/core-bundle[3.18.0].

    • Conclusion: remove doctrine/doctrine-bundle 2.0.7

    • Conclusion: don't install doctrine/doctrine-bundle 2.0.7

    • twig/twig v2.0.0 conflicts with doctrine/doctrine-bundle[2.0.7].

    • twig/twig v2.1.0 conflicts with doctrine/doctrine-bundle[2.0.7].

    • twig/twig v2.2.0 conflicts with doctrine/doctrine-bundle[2.0.7].

    • twig/twig v2.3.0 conflicts with doctrine/doctrine-bundle[2.0.7].

    • twig/twig v2.3.1 conflicts with doctrine/doctrine-bundle[2.0.7].

    • twig/twig v2.3.2 conflicts with doctrine/doctrine-bundle[2.0.7].

    • Installation request for doctrine/doctrine-bundle (locked at 2.0.7) -> satisfiable by doctrine/doctrine-bundle[2.0.7].

    • Installation request for sonata-project/admin-bundle ^3.65 -> satisfiable by sonata-project/admin-bundle[3.65.0].

    • Conclusion: don't install twig/twig v3.0.3|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2

    • Conclusion: remove twig/twig v3.0.3|install twig/twig v2.0.0|install twig/twig v2.1.0|install twig/twig v2.2.0|install twig/twig v2.3.0|install twig/twig v2.3.1|install twig/twig v2.3.2

    • sonata-project/core-bundle 3.18.0 requires twig/twig ^1.34 || ^2.0 -> satisfiable by twig/twig[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, v1.42.5, 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.12.3, v2.12.4, v2.12.5, 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].

    • Can only install one of: twig/twig[v1.41.0, v3.0.3].

    • Can only install one of: twig/twig[v1.42.0, v3.0.3].

    • Can only install one of: twig/twig[v1.42.1, v3.0.3].

    • Can only install one of: twig/twig[v1.42.2, v3.0.3].

    • Can only install one of: twig/twig[v1.42.3, v3.0.3].

    • Can only install one of: twig/twig[v1.42.4, v3.0.3].

    • Can only install one of: twig/twig[v1.42.5, v3.0.3].

    • Can only install one of: twig/twig[v2.10.0, v3.0.3].

    • Can only install one of: twig/twig[v2.11.0, v3.0.3].

    • Can only install one of: twig/twig[v2.11.1, v3.0.3].

    • Can only install one of: twig/twig[v2.11.2, v3.0.3].

    • Can only install one of: twig/twig[v2.11.3, v3.0.3].

    • Can only install one of: twig/twig[v2.12.0, v3.0.3].

    • Can only install one of: twig/twig[v2.12.1, v3.0.3].

    • Can only install one of: twig/twig[v2.12.2, v3.0.3].

    • Can only install one of: twig/twig[v2.12.3, v3.0.3].

    • Can only install one of: twig/twig[v2.12.4, v3.0.3].

    • Can only install one of: twig/twig[v2.12.5, v3.0.3].

    • Can only install one of: twig/twig[v1.34.0, v3.0.3].

    • Can only install one of: twig/twig[v1.34.1, v3.0.3].

    • Can only install one of: twig/twig[v1.34.2, v3.0.3].

    • Can only install one of: twig/twig[v1.34.3, v3.0.3].

    • Can only install one of: twig/twig[v1.34.4, v3.0.3].

    • Can only install one of: twig/twig[v1.35.0, v3.0.3].

    • Can only install one of: twig/twig[v1.35.1, v3.0.3].

    • Can only install one of: twig/twig[v1.35.2, v3.0.3].

    • Can only install one of: twig/twig[v1.35.3, v3.0.3].

    • Can only install one of: twig/twig[v1.35.4, v3.0.3].

    • Can only install one of: twig/twig[v1.36.0, v3.0.3].

    • Can only install one of: twig/twig[v1.37.0, v3.0.3].

    • Can only install one of: twig/twig[v1.37.1, v3.0.3].

    • Can only install one of: twig/twig[v1.38.0, v3.0.3].

    • Can only install one of: twig/twig[v1.38.1, v3.0.3].

    • Can only install one of: twig/twig[v1.38.2, v3.0.3].

    • Can only install one of: twig/twig[v1.38.3, v3.0.3].

    • Can only install one of: twig/twig[v1.38.4, v3.0.3].

    • Can only install one of: twig/twig[v1.39.0, v3.0.3].

    • Can only install one of: twig/twig[v1.39.1, v3.0.3].

    • Can only install one of: twig/twig[v1.40.0, v3.0.3].

    • Can only install one of: twig/twig[v1.40.1, v3.0.3].

    • Can only install one of: twig/twig[v2.4.0, v3.0.3].

    • Can only install one of: twig/twig[v2.4.1, v3.0.3].

    • Can only install one of: twig/twig[v2.4.2, v3.0.3].

    • Can only install one of: twig/twig[v2.4.3, v3.0.3].

    • Can only install one of: twig/twig[v2.4.4, v3.0.3].

    • Can only install one of: twig/twig[v2.4.5, v3.0.3].

    • Can only install one of: twig/twig[v2.4.6, v3.0.3].

    • Can only install one of: twig/twig[v2.4.7, v3.0.3].

    • Can only install one of: twig/twig[v2.4.8, v3.0.3].

    • Can only install one of: twig/twig[v2.5.0, v3.0.3].

    • Can only install one of: twig/twig[v2.6.0, v3.0.3].

    • Can only install one of: twig/twig[v2.6.1, v3.0.3].

    • Can only install one of: twig/twig[v2.6.2, v3.0.3].

    • Can only install one of: twig/twig[v2.7.0, v3.0.3].

    • Can only install one of: twig/twig[v2.7.1, v3.0.3].

    • Can only install one of: twig/twig[v2.7.2, v3.0.3].

    • Can only install one of: twig/twig[v2.7.3, v3.0.3].

    • Can only install one of: twig/twig[v2.7.4, v3.0.3].

    • Can only install one of: twig/twig[v2.8.0, v3.0.3].

    • Can only install one of: twig/twig[v2.8.1, v3.0.3].

    • Can only install one of: twig/twig[v2.9.0, v3.0.3].

    • Installation request for twig/twig (locked at v3.0.3) -> satisfiable by twig/twig[v3.0.3].

      ```

As explained in the error message ; don't install Twig 3, install Twig 2.

Was this page helpful?
0 / 5 - 0 ratings