My current version of Shopware has a small problem, for which I'd like to implement the following patch: https://gitlab.com/mh2017/shopware6-patches/-/raw/master/core/variant-listing-updater.patch
To implement this patch I am using the cweagans/composer-patches plug-in. When running composer update the Shopware Core is attempted to be removed and re-installed:
Gathering patches for root package.
Removing package shopware/core so that it can be re-installed and re-patched.
- Removing shopware/core (6.4.7.0)
However the removal of the Core fails, as the update command fails:
> [ ! -f vendor/autoload.php ] || $PHP_BINARY bin/console system:update:prepare
ErrorException {#7
#message: "Warning: include(/var/www/html/vendor/composer/../shopware/core/Framework/Plugin/KernelPluginLoader/StaticKernelPluginLoader.php): failed to open stream: No such file or directory"
#code: 0
#file: "./vendor/symfony/error-handler/DebugClassLoader.php"
#line: 349
#severity: E_WARNING
trace: {
./vendor/symfony/error-handler/DebugClassLoader.php:349 { …}
./bin/console:49 {
›
› $pluginLoader = new StaticKernelPluginLoader($classLoader, null);
›
}
}
}
Script [ ! -f vendor/autoload.php ] || $PHP_BINARY bin/console system:update:prepare handling the pre-update-cmd event returned with error code 255
This seems to be due to the fact that the core isn't there when attempting to run this command. When attempting to run this with the --no-scripts command, the command does run but also does not patch the Shopware version (as it is also a script).
What would be the best way to apply patches to the Shopware core that also ensures that composer runs smoothly?