![]() |
Hey there,
I've been busy upgrading my CI4 instance from 4.2.0 to 4.4.1. All went smooth until the step up to 4.4.0. redirect()->route() returns $this->redirect(site_url()) Inside the site_url helper func, $currentURI is set from Services::request()->getUri();. However, getUri returns an instance of URI instead of the expected SiteURI. $currentUri->siteUrl() is returned, but siteUrl is only present in the previously mentioned SiteURI. I've researched this a bit and saw an issue regarding this exact thing, however it only concerned CLI and the fix in dev doesn't help me. Am I missing something? Hope someone can help me out here. I'm using nginx with php7.4-fpm (09-26-2023, 09:50 AM)JustJohnQ Wrote: Does this help: Thanks for the reply. Sadly doesn't help. I'm aware of the change, the issue is that the code in question is from CI4 itself, I can't modify it to use on prod. For some reason the site_url CI helper still uses URI, which doesn't have the ->siteUrl function, instead of SiteURI.
Services::request()->getUri() should return SiteURI.
Find why it returns URI. Did you customize CI4 or Config\Services? (09-26-2023, 07:45 PM)kenjis Wrote: Services::request()->getUri() should return SiteURI. I'm using composer and upgraded the version step by step just like it says in the upgrading docs. app/Config/Services does have two custom functions, the issue persists after removing them though. get_class($currentUri) returns URI for me. system/HTTP/Request.php typehint also says it only returns URI Well okay, I seemed to have missed something. I had to update tests/_support/Config/Services.php. All working again. Thanks for the assistance |
Welcome Guest, Not a member yet? Register Sign In |