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
[NodeBundle] Use flashbag from session #2661
Conversation
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.
Hi @, your PR needs some changes
- This PR seems to need a milestone of a minor release.
- your PR title should look like
[SomeBundle] Fixed some code
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.
Hi @, your PR passed all our requirements.
Thank you for contributing!
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.
@dannyvw thanks for the PR! But changing a typehint in the constructor is actually a BC break for users extending this listener. It would be better to remove the type of the flashbag constructor parameter (add the correct typehint in comments) and check in the constructor if we receive the session of the flashbag.
- If we receive the session, assign
$session->getFlashBag()
to$this->flashbag
- If we receive the old parameter (flashbag), trigger a deprecation and still assign it to the property.
You can see an example of this approach int he config controller:
line 65:
/* Environment */ $twig, |
line 78-80:
KunstmaanBundlesCMS/src/Kunstmaan/ConfigBundle/Controller/ConfigController.php
Lines 78 to 80 in 87dac63
if ($twig instanceof EngineInterface) { | |
@trigger_error('Passing the "@templating" service as the 2nd argument is deprecated since KunstmaanConfigBundle 5.4 and will be replaced by the Twig renderer in KunstmaanConfigBundle 6.0. Injected the "@twig" service instead.', E_USER_DEPRECATED); | |
} |
Thanks!
src/Kunstmaan/NodeBundle/EventListener/NodeTranslationListener.php
Outdated
Show resolved
Hide resolved
bd1d016
to
849ad62
Compare
@acrobat The PR is changed. Not sure about the version. Is this correct? |
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.
The master branch is indeed the correct target! One minor comment about the deprecation message and can you check the styleci comments? Thanks!
src/Kunstmaan/NodeBundle/EventListener/NodeTranslationListener.php
Outdated
Show resolved
Hide resolved
@acrobat Fixed. Thanks for the quick response. |
Thanks for the PR and the quick fixes @dannyvw! |
Because of symfony/symfony#36063 the session is now always started. Besides that is the service deprecated in symfony/symfony#36273