Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oksana-c/1528032f1ff6e6802f2b65ef647fe053 to your computer and use it in GitHub Desktop.
Save oksana-c/1528032f1ff6e6802f2b65ef647fe053 to your computer and use it in GitHub Desktop.
Apply Drupal 8 patch using Composer without updating package version
  1. edit the composer.json file to add a patch.
"extra": {
    "enable-patching": true,
    "patches": {
        "drupal/core": {
            "<patch1 information>": "<patch1 file path>",
            "<patch2 information>": "<patch2 file path>"
        }
     }
}
  1. composer install

After composer install, sometimes composer.lock file might not be updated with latest patch information.

  1. composer update --lock

This will generate composer.lock file from composer.json with latest patch additions.

Same steps used to apply patch for a module.

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