Most Drupal distributions use a Composer patching package called
"cweagans/composer-patches". This package handles the patching mechanism nicely.
However, there are a number of problems we have had while maintaining Varbase and building sites on Varbase. Those problems are:
There's no logging mechanism for failed patches
Patches most of the times get included in new releases, there's no way this package can detect if the patch is already included in the new release
These issues become quite irritating and when maintaining a Drupal site, as Varbase and other Drupal distros rely on patches to work well.
Therefore, we have thought of a better way to handle patching (it's now implemented in Varbase 8.6.3 and above). You'll need to update your Varbase version to make use of this patching mechanism.
When you execute
composer update or
composer require vendor/xyz command, newer versions of modules or core are downloaded. If patches for those modules are included, there are 3 possible scenarios:
Patch Applying Scenario
Patch is Still Needed?
Patch Will Apply?
Manual Action Needed?
1. Best Case: Patch has not been included, and new version did not break the patch.
✅ Nothing needed
2. Average Case: Patch has been included in the new version.
❌ You have to remove the patch from
3. Worst Case: Patch has not been included, and new version did break the patch.
❌ You have to manually re-roll the patch, handle conflict, and fix it yourself
Based on the scenarios mentioned above, we have forked the
"cweagans/composer-patches" package, and added an Event Dispatcher on patch failure. The Event Dispatcher will dispatch an Event that will prompt you to perform an action depending on the scenarios above. Thus:
Example screenshot below:
Example screenshot of
If you're using Varbase 8.6.3 or greater, just run
composer update and it will work.
If you're using Varbase 8.6.2 or older, you can update to the most recent version of Varbase 8.6.x and make use of this functionality, or by running the following commands:
From a command prompt window, navigate to your project:
Add Vardot's composer-patches repository to use our forked package instead of the cweagans's.
composer config repositories.composer-patches vcs https://github.com/vardot/composer-patches
Require the Varbase Updater package. (Requiring the package only without running the update command will add the Composer plugins for patching but won't update Varbase. To update, you need to run the update command).
composer require vardot/varbase-updater
composer update to get the new package and start applying the new patching mechanism.