I’m running into an issue where the CP/URL service is not using the config item cp_url
and instead uses SELF
.
In the screenshot I’m dumping:
ee()->config->item('cp_url');
ee('CP/URL', 'cp/members/profile/settings')->setQueryStringVariable('id', $memberId);
ee('CP/URL', 'cp/members/profile/settings')->setQueryStringVariable('id', $memberId)->compile();
As you can see, cp_url
is set, but the URL class’s base
is wrong.
From inspecting the URLFactory class, it seems the problem is either in the constructor when setting the default_cp_url
or the make method using the default_cp_url
instead of checking cp_url
first.
Hi TJ, we have it this way so that URLs can be correctly generated to either admin.php or index.php, whichever you’re accessing, and also if you’re accessing the CP across other domains via MSM. So we try to leave out the typically hard-coded cp_url
setting when we can.
But I saw in Slack you were having trouble redirecting with one of these URLs? We redirect using URLs generated via the CP/URL service all the time and have never heard of the browser attempting to redirect back to root. Can you share what you’re doing differently than us?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.