PHPackages                             amcgowanca/composer-patches-drupal-patching - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. amcgowanca/composer-patches-drupal-patching

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

amcgowanca/composer-patches-drupal-patching
===========================================

A work-around solution for patching Drupal 8 core with cweagans/composer-patches.

0.0.2(7y ago)15.6kPHPPHP &gt;=5.6.0

Since Jan 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/amcgowanca/composer-patches-drupal-patching)[ Packagist](https://packagist.org/packages/amcgowanca/composer-patches-drupal-patching)[ RSS](/packages/amcgowanca-composer-patches-drupal-patching/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Patching Drupal 8 core with `cweagans/composer-patches`
-------------------------------------------------------

[](#patching-drupal-8-core-with-cweaganscomposer-patches)

This package provides a work-around for the issue in which Drupal 8 core package patches, applied through the use of `cweagans/composer-patches`, does not correctly apply patches to Drupal core itself. Instead, a common symptom of incorrectly applied patches is the creation of the directories: `docroot/core/b/` or `docroot/core/core`. This appears to be the result of a `composer.json`'s specification of the `drupal/core` project's installation path being `docroot/core`. This is commonly seen in Acquia BLT (and potentially Acquia Lightning) based projects.

This Composer Plugin provides a mechanism to resolve the issue so that patches defined in a `composer.json` for Drupal core can be applied to `docroot` vs. `docroot/core` through modification of the installation path at time of pre-patch apply events that are fired through `cweagans/composer-patches` plugin. However, this ultimately warrants modifications to the Composer Patches project to allow for the modification of the `$install_path` value which can be seen through the changes outlined [here](https://github.com/amcgowanca/composer-patches/commit/2eeba8aa7ecca90b69a6c7386522635783e553cf).

### Usage

[](#usage)

- The project's `composer.json` file *must* specify the new repository in which the `cweagans/composer-patches` project is retrieved from. This can be done by adding the following to your `composer.json`'s `repositories` property:

```
"cweagans/composer-patches": {
  "type": "vcs",
  "url": "git@github.com:amcgowanca/composer-patches.git"
},

```

- Your `composer.json` should specify as a `required` package, the `cweagans/composer-patches` as the first possible package to retrieve (prior to Acquia BLT *or* Lightning where `"merge-plugin"."replace"` is `false`). This package should have a version of `1.x-dev`.

```
"cweagans/composer-patches": "1.x-dev"

```

- Your `composer.json` should require this package, available as:

```
"amcgowanca/composer-patches-drupal-patching": "^0.0.1"

```

- Depending on your current workflow for your project, you may need to execute a "nuke" operation to rebuild your project's dependencies effectively and accurately. *Note* that you may (and it is likely) during your first time for executing a complete `composer install` or update operation to notice that some of the defined Drupal 8 core patches no longer apply. It should be noted that these most likely did not ever apply and silently were ignored.

### Related issues &amp; resources

[](#related-issues--resources)

The following is a collection of high-level issues and resources related to the *core* problem that this plugin (and the modified `cweagans/composer-patches`) helps address:

- [cweagans/composer-patches#178](https://github.com/cweagans/composer-patches/issues/178)
- [cweagans/composer-patches#165](https://github.com/cweagans/composer-patches/pull/165)
- [cweagans/composer-patches#174](https://github.com/cweagans/composer-patches/issues/174)
-
- [acquia/blt#2309](https://github.com/acquia/blt/issues/2309)
-

### Example repository

[](#example-repository)

An example repository has been put together to contain an example of a clean Acquia BLT project setup in which the error that this Composer Plugin aims to resolve, in addition to an example in which the problem at hand is in fact solved. More information can be found at [amcgowanca/composer-patches-drupal-patching-proof](https://github.com/amcgowanca/composer-patches-drupal-patching-proof).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~206 days

Total

2

Last Release

2836d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/611e78e95ac720d290f97d7df2c279c0c3a703f22caae1114b7885d503844b36?d=identicon)[amcgowanca](/maintainers/amcgowanca)

---

Top Contributors

[![amcgowanca](https://avatars.githubusercontent.com/u/316512?v=4)](https://github.com/amcgowanca "amcgowanca (9 commits)")

---

Tags

acquiabltcomposerdrupallightning

### Embed Badge

![Health badge](/badges/amcgowanca-composer-patches-drupal-patching/health.svg)

```
[![Health](https://phpackages.com/badges/amcgowanca-composer-patches-drupal-patching/health.svg)](https://phpackages.com/packages/amcgowanca-composer-patches-drupal-patching)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M446](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[olvlvl/composer-attribute-collector

A convenient and near zero-cost way to retrieve targets of PHP 8 attributes

184108.8k8](/packages/olvlvl-composer-attribute-collector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
