Action "Page redirect" needs to be ported to Rules 8.x-3.x.
Remaining tasks
- Implement restriction, optional and defaultValue contexts.
- Test if "Append destination parameter" works.
- Test if "Force redirection" works.
- Add code to exclude Rules administration pages from redirections in order not to lock out admins
Comments
Comment #1
bbujisic commentedComment #2
bbujisic commentedhttps://github.com/fago/rules/pull/178
Comment #3
dasjoComment #4
dasjoSetting to needs work based on the comments left on the pull request
Comment #5
bbujisic commentedStill, lots of todo's, but at least comments on pull request were attended.
Comment #6
klausiGood start, thanks!
I think we need to implement a RedirectResponseSubscriber similar to Drupal\Core\EventSubscriber\RedirectResponseSubscriber .
So the workflow would be:
1) Action gets executed and sets the redirect target. Maybe just a static variable on the SystemPageRedirect class? SystemPageRedirect::redirectTraget?
2) When the response is generated and the KernelEvents::RESPONSE event triggers our RedirectResponseSubscriber kicks in. It checks SystemPageRedirect::redirectTraget and if it is not empty we know that we have to issue a redirect. It generates a redirect response object and sets that on the event.
Comment #7
mariancalinro commentedComment #8
mariancalinro commentedhttps://github.com/fago/rules/pull/295
Comment #9
mariancalinro commentedComment #10
mariancalinro commentedComment #11
mariancalinro commentedComment #12
klausimerged, thanks!