Skip to content
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

chore: allowing support of Symfony 7 #462

Merged
merged 1 commit into from
Nov 23, 2023
Merged

chore: allowing support of Symfony 7 #462

merged 1 commit into from
Nov 23, 2023

Conversation

pauljosephkrogulec
Copy link
Contributor

@pauljosephkrogulec pauljosephkrogulec commented Nov 21, 2023

allowing support of Symfony 7

I am targeting this branch, because is for allowing the possibility of use in symfony 7 project and don't create a BC-break

Changelog

Allowing support of Symfony 7 (@pauljosephkrogulec)

### Added
- Support of Symfony 7

composer.json Outdated Show resolved Hide resolved
@VincentLanglet
Copy link
Member

HI @pauljosephkrogulec

In order to support Symfony 7 we need to be able to run CI with it, like I tried
here: https://github.com/sonata-project/EntityAuditBundle/pull/592/files#diff-245392b692a50c38ecab4381b118862db514035c10983f3bd4f4b7f1f4be4692R60-R64

But, currently SF 7 doesn't run on our build because of PHP-CS-Fixer, cf
https://github.com/sonata-project/EntityAuditBundle/actions/runs/6954735614/job/18922120160?pr=592

Let's wait an answer on PHP-CS-Fixer/PHP-CS-Fixer#7431 (comment)

Copy link
Member

@VincentLanglet VincentLanglet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the github actions like in sonata-project/twig-extensions#392 in order to be sure that SF 7 can be installed ? Thanks

@VincentLanglet
Copy link
Member

You'll need

"matthiasnoback/symfony-config-test": "^4.2 || ^5.1",
"matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0",

@VincentLanglet
Copy link
Member

There is one test failure:

1) Sonata\Form\Tests\Type\FormChoiceWidgetTest::testLabelRendering
Failed asserting that '<div id="choice"><input type="checkbox" id="choice_0" name="choice[]" value="0"><label for="choice_0">[trans]some[/trans]</label><input type="checkbox" id="choice_1" name="choice[]" value="1"><label for="choice_1">[trans]choices[/trans]</label></div>' contains "<div id="choice"><input type="checkbox" id="choice_0" name="choice[]" value="0" /><label for="choice_0">[trans]some[/trans]</label><input type="checkbox" id="choice_1" name="choice[]" value="1" /><label for="choice_1">[trans]choices[/trans]</label></div>".

We'll need to understand what's changed in SF7

@pauljosephkrogulec
Copy link
Contributor Author

pauljosephkrogulec commented Nov 23, 2023

There is one test failure:

1) Sonata\Form\Tests\Type\FormChoiceWidgetTest::testLabelRendering
Failed asserting that '<div id="choice"><input type="checkbox" id="choice_0" name="choice[]" value="0"><label for="choice_0">[trans]some[/trans]</label><input type="checkbox" id="choice_1" name="choice[]" value="1"><label for="choice_1">[trans]choices[/trans]</label></div>' contains "<div id="choice"><input type="checkbox" id="choice_0" name="choice[]" value="0" /><label for="choice_0">[trans]some[/trans]</label><input type="checkbox" id="choice_1" name="choice[]" value="1" /><label for="choice_1">[trans]choices[/trans]</label></div>".

We'll need to understand what's changed in SF7

The error is cause by the adding of / in the of the input (/> => >)

@VincentLanglet
Copy link
Member

The error is cause by the adding of / in the of the input (/> => >)

Sure, but removing the / won't solve our issue. It will solve the error on SF7 but tests on SF5-6 will fail.
Also, does the html is still valid without the / ? Maybe Symfony has a regression which need to be reported...

@pauljosephkrogulec
Copy link
Contributor Author

pauljosephkrogulec commented Nov 23, 2023

The error is cause by the adding of / in the of the input (/> => >)

Sure, but removing the / won't solve our issue. It will solve the error on SF7 but tests on SF5-6 will fail. Also, does the html is still valid without the / ? Maybe Symfony has a regression which need to be reported...

The problem come from the bundle symfony/twig-bridge symfony/twig-bridge@dcb5bb8
I have a solution with a if but i don't know if it's a good one using Kernel::VERSION

@VincentLanglet
Copy link
Member

The problem come from the bundle symfony/twig-bridge symfony/twig-bridge@dcb5bb8

thanks for the research. So it's a "feature" from Symfony.

I have a solution with a if but i don't know if good one using Kernel::VERSION

I would be ok with this.

chore: migration symfony 7
@VincentLanglet VincentLanglet merged commit 1175703 into sonata-project:2.x Nov 23, 2023
22 checks passed
@VincentLanglet
Copy link
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants