-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Referer is not saved in the session for custom backend routes #7190
Comments
Imho we should just replace && 'contao_backend' === $request->attributes->get('_route') with something like && 'backend' === $request->attributes->get('_scope')
&& false !== $request->attributes->get('_store_referrer') and adjust the backend routes of the Contao core that should not store the referer accordingly. |
That sounds reasonable. Any other ideas? |
One question is: should it be opt-in rather than opt-out. With my suggestion it would store the referrer by default and you can opt out - but that means we have to set |
Description ----------- #7190 This implements my opt-out suggestion from #7190 (comment). Any back end route will now store the referrer by default - but you can opt-out via `_store_referrer: false` in your route defaults/attributes. /cc @ameotoko Commits ------- cadf65a Always store referrer for backend _scope 0cfb6ec Make the configuration explicit Co-authored-by: leofeyer <1192057+leofeyer@users.noreply.github.com>
Description ----------- #7190 This implements my opt-out suggestion from contao/contao#7190 (comment). Any back end route will now store the referrer by default - but you can opt-out via `_store_referrer: false` in your route defaults/attributes. /cc @ameotoko Commits ------- cadf65a3 Always store referrer for backend _scope 0cfb6ec2 Make the configuration explicit Co-authored-by: leofeyer <1192057+leofeyer@users.noreply.github.com>
Description ----------- #7190 This implements my opt-out suggestion from contao/contao#7190 (comment). Any back end route will now store the referrer by default - but you can opt-out via `_store_referrer: false` in your route defaults/attributes. /cc @ameotoko Commits ------- cadf65a3 Always store referrer for backend _scope 0cfb6ec2 Make the configuration explicit Co-authored-by: leofeyer <1192057+leofeyer@users.noreply.github.com>
Affected version(s)
4.13
Description
In my custom backend route, I have a link to the user profile, and I want the “Go back” button to lead back to my route. But this doesn’t work, the route is never stored in the session under
'referer'
, and the button leads to the last visited “core” backend url. Custom backend routes are skipped.The developer docs say here:
However, the referer is not actually stored in this case, because
StoreRefererListener
specifically checks for thecontao_backend
route here:contao/core-bundle/src/EventListener/StoreRefererListener.php
Lines 88 to 97 in 74afbb0
I was able to verify that by commenting out just that one line.
The text was updated successfully, but these errors were encountered: