Error in user YAML: (<unknown>): found character that cannot start any token while scanning for the next token at line 5 column 16
---
title: Load additional bundles in order
issue: NEXT-17948
author: Joshua Behrens
author_email: [email protected]
author_github: @JoshuaBehrens
---
- Changed bundle loading order by the keys from
\Shopware\Core\Framework\Plugin::getAdditionalBundles
in\Shopware\Core\Framework\Plugin\KernelPluginLoader\KernelPluginLoader::getBundles
to allow bundle loading prior the plugin itself
When you depend on a self-shipped bundle to already been loaded before your plugin, you can now use negative keys in getAdditionalBundles
to express a different order. Use negative keys to load them before your plugin instance:
class AcmePlugin extends Plugin
{
public function getAdditionalBundles(AdditionalBundleParameters $parameters): array
{
return [
-10 => new DependencyBundle(),
];
}
}