Skip to content

Conversation

alexander-schranz
Copy link
Member

@alexander-schranz alexander-schranz commented Aug 30, 2023

Q A
Bug fix? yes
New feature? no
BC breaks? yes
Deprecations? no
Fixed tickets fixes #
Related issues/PRs sulu/SuluArticleBundle#647
License MIT
Documentation PR sulu/sulu-docs#

What's in this PR?

Fix incompatibility to Symfony 6.4 renderBlock method.

Why?

Symfony introduced its own renderBlock method and we need to migrate to the compatible renderBlockView method.

Upgrade

Actually the upgrade here is hard, from Sulu side it would be.

// before
$this->renderBlock(...);

// after
$this->renderBlockView(...);

but this would manipulate all renderBlock methods and rector rules should work always. So in this case we would need a custom rule which checks if the result of renderBlock/renderBlockView is used as a string or response.

// before
$response = $this->renderBlock(...);
$string = $this->renderBlock(...);

new Response($string);

// after
$response = $this->renderBlock(...);
$string = $this->renderBlockView(...);

new Response($string);

So that is the hard case here to create automatic upgrade 🤔 . Inheritance make things always harder then composition.

@alexander-schranz alexander-schranz added Bug Error or unexpected behavior of already existing functionality DX Affecting the end developer labels Aug 30, 2023
@alexander-schranz alexander-schranz force-pushed the bugfix/fix-incompatibility-to-symfony-6-4 branch 2 times, most recently from 7385350 to c8c5923 Compare August 30, 2023 17:37
@alexander-schranz alexander-schranz force-pushed the bugfix/fix-incompatibility-to-symfony-6-4 branch from 48f268b to e701fd1 Compare August 30, 2023 20:37
alexander-schranz and others added 2 commits August 30, 2023 22:39
Co-authored-by: Prokyonn <daniel.mathis@sector8.eu>
@alexander-schranz alexander-schranz force-pushed the bugfix/fix-incompatibility-to-symfony-6-4 branch from e701fd1 to 85b7f75 Compare August 30, 2023 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Error or unexpected behavior of already existing functionality DX Affecting the end developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants