We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom aliases are not loaded from the general config when using the test framework.
[Twig\Error\RuntimeError] An exception has been thrown during the rendering of a template ("Invalid path alias: @aliasNameHere").
I seem to have been able to fix the issue by adding the following code:
$configService = self::createConfigService(); $generalConfig = $configService->getConfigFromFile('general'); // Set any custom aliases $customAliases = $generalConfig['aliases'] ?? $generalConfig['environmentVariables'] ?? null; if (is_array($customAliases)) { foreach ($customAliases as $name => $value) { if (is_string($value)) { Craft::setAlias($name, $value); } } }
Here:
https://github.com/craftcms/cms/blob/develop/src/test/TestSetup.php#L346
The text was updated successfully, but these errors were encountered:
d69f526
Craft 3.4.20 is out now with this change.
Sorry, something went wrong.
angrybrad
No branches or pull requests
Description
Custom aliases are not loaded from the general config when using the test framework.
Steps to reproduce
[Twig\Error\RuntimeError] An exception has been thrown during the rendering of a template ("Invalid path alias: @aliasNameHere").
I seem to have been able to fix the issue by adding the following code:
Here:
https://github.com/craftcms/cms/blob/develop/src/test/TestSetup.php#L346
Additional info
The text was updated successfully, but these errors were encountered: