Welcome Guest, Not a member yet? Register   Sign In
'Improved' Auto Router exception skips filter for 404 controller
#3

Thanks for your help!

I uploaded a minimal demo for the issue: https://github.com/Saddalim/ci4_autoroute_filter

IRL, we would need the results of MagicFilter::before in Home::error404. Please ignore the ugly static, it's for the easy demo...
If you try to load a nonexisting controller, you'll see that the filter runs with the legacy router, but if you switch $autoRoutesImproved to true, it does not.

As a quick workaround in the original app, I moved functionality of the filter to a library class and called it from both the filter and and 404 error handler method (or alternatively I could have used a trait I believe), but I would prefer a less smelly solution.
Reply


Messages In This Thread
RE: 'Improved' Auto Router exception skips filter for 404 controller - by saddalim - 01-31-2023, 10:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB