Welcome Guest, Not a member yet? Register   Sign In
hot-reload side effects seem to be clobbering my app
#8

Gents I really appreciate your time and efforts, so thx!
I have commented out "toolbar" in Filters and that has made no difference.
Perhaps I can give you a little background which might help you to help me.
The code was originally written over 10 years ago for our website. I inherited the code base and have supported it ever since. Under CI3 it all works really well. However one aspect of our site performs too slowly (big searches of a large table) and we now have a helper who loves Algolia. BUT to implement that we need to go to PHP8 (we were on 7.4).
I have gallantly (perhaps foolishly) taken on the upgrades and bitten the CI4 task to future proof the site.
I have some of it working but keep on tripping up on things that at first sight should be simple. (PS We did code our own login and logout which worked fine in CI3)
Redirection seems to be very mysterious. The upgrade guide suggests replacing all my original redirects with redirect()->to, which I have done. But as it stands today I have 2 big redirect issues:
1) When I "redirect()->to('logout') the routes entry says run "User::logout" which then calls a model UserAuthenticateModel to actually send messages, close sessions and finally redirect()->to('login'). This simply doesn't work and I end up with a blank screen instead of the login view. I also notice that the url remains at "https://localhost/logout"
2) A similar problem happens when I get to a dialog for uploading a file. The view gets displayed fine, loads of JS files manage the upload with a php Library. I then present a "next" button which post the data to a form "action". This should go back to the controller which then builds and displays the next view for the user to configure more stuff. BUT it doesn't somehow find or run the route and simply reproduces the same image upload view.
Am I missing a fundamental CI4 design pattern here? Do all redirects have to be from a controller perhaps?
Do I need to pass something extra in the Model constructor parms?
I notice the docs suggest using redirect()->route for named routes. Is that different to to()?
How crucial is the leading '/'. I have gone round in endless loops trying alternatives and still haven't solved my issues.
So if you can suggest where to go next that would be good. I'm sure if we were to rewrite the whole app with CI4 in mind it would look a bit different, but I sadly don't have the time or energy for that commitment.
Regards Paul
Reply


Messages In This Thread
RE: hot-reload side effects seem to be clobbering my app - by PaulC - 6 hours ago



Theme © iAndrew 2016 - Forum software by © MyBB