I’ve got a plugin (dispatchLoopStartup) that checks if a user is allowed to access certain sections of a site without being logged in. If they try and access a restricted section they get forwarded to the login page, like this:
$request->setControllerName('login');
$request->setActionName('cms');
I’ve got another plugin (preDispatch) that retrieves data from the database based on the current action. When the request has been forwarded to a different action this plugin still reads the request as it was before it was forwarded.
How can I get the updated request in the 2nd plugin?
Silly error on my part. I was accessing the module/controller/action via
$request->getParams()rather than :getParams() returned the params pre forward which is why I was being confused.