Skip to content

Commit b8b64c9

Browse files
authored
Merge pull request #16980 from craftcms/bugfix/alias-env
Set from CRAFT_WEB_URL and CRAFT_WEB_ROOT after custom aliases
2 parents eba8861 + 6bbb121 commit b8b64c9

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

CHANGELOG-WIP.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
- Date values for custom fields are now represented as ISO-8601 date strings (with time zones) within element exports. ([#16629](https://github.com/craftcms/cms/pull/16629))
4141
- “Updating search indexes” queue jobs no longer do anything if search indexes were already updated for the element since the job was created. ([#16644](https://github.com/craftcms/cms/pull/16644))
4242
- User caches are no longer invalidated on login attempts or when user management actions are taken. ([#16937](https://github.com/craftcms/cms/pull/16937))
43-
- Batchable queue jobs now spawn new batches when their execution time is getting uncomfortably close to their TTR duration. ([#16947](https://github.com/craftcms/cms/pull/16947))
43+
- Batchable queue jobs now spawn new batches when their execution time is getting uncomfortably close to their TTR duration. ([#16947](https://github.com/craftcms/cms/pull/16947))
4444
- Updated Yii to 2.0.52.
4545
- Updated yii2-debug to 2.1.26.
4646
- Updated Axios to 1.8.4.
47+
- Fixed a bug where `CRAFT_WEB_URL` and `CRAFT_WEB_ROOT` environment variables could be overridden by `@web` and `@webroot` aliases define by the `aliases` config setting. ([#16980](https://github.com/craftcms/cms/pull/16980))

bootstrap/bootstrap.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,13 @@
206206
Craft::setAlias('@translations', $translationsPath);
207207
Craft::setAlias('@tests', $testsPath);
208208

209+
// Set any custom aliases
210+
foreach ($generalConfig->aliases as $name => $value) {
211+
if (is_string($value)) {
212+
Craft::setAlias($name, $value);
213+
}
214+
}
215+
209216
$webUrl = App::env('CRAFT_WEB_URL');
210217
if ($webUrl) {
211218
Craft::setAlias('@web', $webUrl);
@@ -216,13 +223,6 @@
216223
Craft::setAlias('@webroot', $webRoot);
217224
}
218225

219-
// Set any custom aliases
220-
foreach ($generalConfig->aliases as $name => $value) {
221-
if (is_string($value)) {
222-
Craft::setAlias($name, $value);
223-
}
224-
}
225-
226226
// Load the config
227227
$components = [
228228
'config' => $configService,

0 commit comments

Comments
 (0)