Does anyone have a suggestion on how to fix this issue without manually modifying CI core code.
CI4 saves a reference to the last requested url so it can do it's redirect()->back() function however when you use ajax it stores that call and when I want to use back on the next page (say a link clicked from the current page) it tries to redirect me back to the ajax page and not the main page.
CI's function that handles this is in
system/Codeigniter.php (
line 969 on my version)
public function storePreviousURL($uri)
I can add an exception inside of this to ignore url's with ajax in the name however I am editing code I shouldn't be touching because it will get overwritten during updates. I am not sure how to intercept this and make changes from the outside. I am not sure how to override this class since it's a level above the core classes that you can extend and override.
Thanks for the help.