Drupal 8: Applying Patches with Composer

Michalak Drupal Commerce Developer

How to apply and manage patches with composer. 

First add the library 'cweagans/composer-patches' to your composer.json

Then under installer-paths in your composer.json add "patches".  "Patches" is then organized by modules.  Here is an example: 

        "installer-paths": {
        "patches": {
          "drupal/commerce_shipping": {
                "Commerce Shipping - Deleted Profile Error": "https://www.drupal.org/files/issues/2018-06-15/commerce_shipping-deleted-profile-error-2969540-6.patch",
                "Patch Label": "https://path-to-patch'

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.