Fixing failing composer patches by updating GNU Patch

Composer patches will silently fail to apply if your machine has certain versions of Git and GNU Patch installed.

If you are using Composer, make sure your version of patch is up to date to avoid this problem.

You can check your version of Patch by running: 

patch --version

To update your version of Patch on a Mac use:

brew install gpatch; brew upgrade gpatch

More details about this issue:

Acquia BLT and Lightning both use the composer-patches package to allow you to apply patches to Drupal modules and core via your composer.json file. Composer patches currently has a bug that causes it to silently fail to apply patches when you run composer install. This bug is only triggered when you have certain versions of Git and Patch and installed. To ensure your system is not affected by this bug, make sure you have Patch version 2.7.5 or greater, which is known to work regardless of your Git version.

The next release of composer patches (likely 1.6.3 or 1.7.0) should fix this bug, regardless of your Git or Patch version. BLT will require the fixed version of composer-patches as soon as it's available, and will add a version check as a safeguard in the meantime.

This bug produces no immediate errors (composer patches fails silently), but causes very strange and hard-to-diagnose behaviors later on. If you use Lightning, most typically you get an error like this during site install due to a failed media patch:

"Configuration objects (,, media.type.image) provided by lightning_media_image already exist in active configuration"


Contact supportStill need assistance? Contact Acquia Support