Skip to content

Instantly share code, notes, and snippets.

@danylevskyi
Last active May 6, 2019 06:29
Show Gist options
  • Save danylevskyi/c13242c1184b63522fa870ff64719130 to your computer and use it in GitHub Desktop.
Save danylevskyi/c13242c1184b63522fa870ff64719130 to your computer and use it in GitHub Desktop.
How to apply patch to Drupal core using Composer

3 steps to patch Drupal core with Composer

Make sure your composer.json has cweagans/composer-patches package.

1. Update composer.json

"extra": {
    "patches": {
        "drupal/core": {
            "<patch1 information>": "<patch1 file path>",
            "<patch2 information>": "<patch2 file path>"
        }
     }
}

2. Apply your patch

composer install

3. Update composer.lock

composer update --lock

Useful links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment