Skip to content

[FrameworkBundle][Messenger] Added RouterContextMiddleware #39688

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

Merged
merged 1 commit into from
Feb 11, 2021

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented Jan 2, 2021

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR TODO

When handling a message in async, we, sometimes need the Router Context to generate absolute URL. ie:

  • sending an email when the message contains only the template
  • generating a PDF

People can use the configuration router.default_uri to workaround and fix the issue, but this does not work when the web application servers several domains.

This PR provide a new middleware that store the current router context in a stamp, and restore the context when processing the message.

@jderusse jderusse added this to the 5.x milestone Jan 2, 2021
@carsonbot carsonbot changed the title [FrameworkBundle] Added RouterContextMiddleware [FrameworkBundle][Messenger] Added RouterContextMiddleware Jan 2, 2021
@jderusse jderusse force-pushed the fwb-router-middleware branch 4 times, most recently from 0a55b33 to b3beab6 Compare January 3, 2021 16:34
@jderusse jderusse force-pushed the fwb-router-middleware branch from b13bb37 to 78b8d3f Compare February 6, 2021 10:25
@jderusse jderusse requested a review from sroze as a code owner February 6, 2021 10:25
@jderusse jderusse force-pushed the fwb-router-middleware branch from 78b8d3f to 1377b21 Compare February 6, 2021 10:30
@nicolas-grekas
Copy link
Member

Error: Call to undefined method Symfony\Component\Routing\RequestContext::fromUri()

on deps=low

@jderusse jderusse force-pushed the fwb-router-middleware branch 2 times, most recently from c5ef324 to 821fa53 Compare February 6, 2021 18:00
@jderusse jderusse force-pushed the fwb-router-middleware branch from 821fa53 to 8fe8b96 Compare February 8, 2021 22:23
@nicolas-grekas
Copy link
Member

Thank you @jderusse.

@jderusse jderusse deleted the fwb-router-middleware branch February 11, 2021 10:29
@fabpot fabpot mentioned this pull request Apr 18, 2021
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.

4 participants