-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add Symfony 5 compatibility #6263
Conversation
ed3cbc7
to
95b12ac
Compare
what you can do (which does not break BC, but looks ugly) if ($symfonyVersion === 4) {
class ChoiceTypeExtension extends AbstractTypeExtension
{
public static function getExtendedTypes()
{
return [ChoiceType::class];
}
}
} else {
class ChoiceTypeExtension extends AbstractTypeExtension
{
public static function getExtendedTypes(): iterable
{
return [ChoiceType::class];
}
}
} this will be a workaround for the symfony 5. And later SonataAdmin 4.x will be released |
95b12ac
to
1b7d151
Compare
why don't you do the same I think With it ( |
I think this case is different, In this case we are not supporting
I created #6275 where we can discuss about that and leave this to Symfony. |
Could you please rebase your PR and fix merge conflicts? |
For one of my projects I also need Symfony 5 compat. Is there any way I can help move this forward? Would be happy to. |
Looks like this is unblocked now. How can I help? |
"symfony/dependency-injection": "^4.4.3", | ||
"symfony/doctrine-bridge": "^4.4", | ||
"symfony/event-dispatcher": "^4.4", | ||
"symfony/asset": "^4.4 || ^5.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for ^4.4 || ^5.1
on Symfony packages rather than ^4.4 || ^5.0
? Is there something hard to support in 5.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symfony 5.0 is EOL (not supported anymore). See https://symfony.com/releases
So does not really make sense to support it here I believe 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it is, sorry 🤦
1b7d151
to
4d9c627
Compare
4d9c627
to
5cdab9c
Compare
@franmomu |
What BC breaks are in this PR? I've seen reference to BC breaks across a few issues/PRs, but not any specific examples. |
public function buildView(FormView $view, FormInterface $form, array $options) | ||
use Symfony\Component\Form\FormTypeExtensionInterface; | ||
|
||
// NEXT_MAJOR: Remove the "else" part, copy all methods from BaseChoiceTypeExtension in this class and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO this is a no go for maintenance cost...
"symfony/framework-bundle": "^4.4 || ^5.1", Using |
Could you please rebase your PR and fix merge conflicts? |
|
It is BC-break. What about translator? There are huge BC-break too. IMO better will be simply add support for Symfony5 in Sonata4, without BC-break. This will save time which we can spend on major release. This move will also encourage people to upgrade Admin to v4 and make less work for as to support v3. |
Hello! |
See #6365 |
Thank you for your answer. |
Closing in favor of #6476 |
Subject
Since #6212, KnpMenuBundle is the only external library that is not compatible with Symfony 5 on the stable branch.So I used #5948 that modifies classes that are marked as final.The other BC-break that I introduced (that I'm aware of) is to add a needed return typeiterable
togetExtendedTypes()
method in the classes (marked as final also) that implementFormTypeExtensionInterface
.I copied
ControllerTrait
from Symfony since it's not available in Symfony 5.I'm aware of #6093 and this is complementary since looks like the main problem for
4.0
is withCRUDController
, so that still needs to be solved.So the question is if this can be acceptable in the stable branch or not, if so we should also consider applying similar to #6212 (adding support to BlockBundle 4) to the bundles we want to be compatible with Symfony 5.
I am targeting this branch, because it would be nice to have Symfony 5 compatibility on the stable branch.
Closes #5788.
Changelog
To do