Download the PHP package amcgowanca/composer-patches-drupal-patching without Composer
On this page you can find all versions of the php package amcgowanca/composer-patches-drupal-patching. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amcgowanca/composer-patches-drupal-patching
More information about amcgowanca/composer-patches-drupal-patching
Files in amcgowanca/composer-patches-drupal-patching
Package composer-patches-drupal-patching
Short Description A work-around solution for patching Drupal 8 core with cweagans/composer-patches.
License
Informations about the package composer-patches-drupal-patching
Patching Drupal 8 core with cweagans/composer-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.
Usage
-
The project's
composer.json
file must specify the new repository in which thecweagans/composer-patches
project is retrieved from. This can be done by adding the following to yourcomposer.json
'srepositories
property: -
Your
composer.json
should specify as arequired
package, thecweagans/composer-patches
as the first possible package to retrieve (prior to Acquia BLT or Lightning where"merge-plugin"."replace"
isfalse
). This package should have a version of1.x-dev
. -
Your
composer.json
should require this package, available as: - 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 & 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:
- https://github.com/cweagans/composer-patches/issues/178
- https://github.com/cweagans/composer-patches/pull/165
- https://github.com/cweagans/composer-patches/issues/174
- https://www.drupal.org/project/drupal/issues/1356276?page=1#comment-12277804
- https://github.com/acquia/blt/issues/2309
- https://docs.acquia.com/article/fixing-failing-composer-patches-updating-gnu-patch
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.
All versions of composer-patches-drupal-patching with dependencies
composer-plugin-api Version ^1.0
cweagans/composer-patches Version 1.x-dev