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

[NodeBundle] Use flashbag from session #2661

Merged
merged 1 commit into from Apr 7, 2020
Merged

Conversation

dannyvw
Copy link
Contributor

@dannyvw dannyvw commented Apr 6, 2020

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes
Fixed tickets

Because of symfony/symfony#36063 the session is now always started. Besides that is the service deprecated in symfony/symfony#36273

Copy link

@ProfessorKuma ProfessorKuma left a 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

@ProfessorKuma ProfessorKuma added this to the 5.6.0 milestone Apr 6, 2020
@dannyvw dannyvw changed the title Use flashbag from session [NodeBundle] Use flashbag from session Apr 6, 2020
Copy link

@ProfessorKuma ProfessorKuma left a 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!

Copy link
Member

@acrobat acrobat left a 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:

line 78-80:

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!

@dannyvw dannyvw force-pushed the flashbag branch 2 times, most recently from bd1d016 to 849ad62 Compare April 6, 2020 16:51
@dannyvw
Copy link
Contributor Author

dannyvw commented Apr 6, 2020

@acrobat The PR is changed. Not sure about the version. Is this correct?

Copy link
Member

@acrobat acrobat left a 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!

@dannyvw
Copy link
Contributor Author

dannyvw commented Apr 6, 2020

@acrobat Fixed. Thanks for the quick response.

@acrobat
Copy link
Member

acrobat commented Apr 7, 2020

Thanks for the PR and the quick fixes @dannyvw!

@acrobat acrobat merged commit 4edda5f into Kunstmaan:master Apr 7, 2020
@dannyvw dannyvw deleted the flashbag branch April 7, 2020 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants