- Issue created by @ph7
- Status changed to Fixed
over 1 year ago 1:32pm 6 April 2023
Applying patches fails on composer install
Given composer create-project vardot/vardoc-project:5.0.0-beta1 [projectdir] --no-dev --no-interaction
When Applying patches for drupal/core
Then Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch →
The issue is apparently caused by the --no-backup-if-mismatch flag in Composer patch on certain OS like for instance FreeBSD
https://github.com/cweagans/composer-patches/issues/159
My resolution to circumvent the problem was as follows:
2) composer create-project vardot/vardoc-project:5.0.0-beta1 kb123 --no-dev --no-interaction --no-install
which extracts the project files: Installing vardot/vardoc-project (5.0.0-beta1): Extracting archive
2) Edit composer.json in the project root and disable patching:
"enable-patching": false,
"composer-exit-on-patch-failure": true,
"patchLevel": {
"drupal/core": "-p2"
},
"patches": {}
}
}
located at the bottom of the composer.json file
3) composer install
4) manually patches from the installer script without the --no-backup-if-mismatch flag. i.e.:
patch '-p2' -d '/var/www/[projectdir]/docroot/core' < '/tmp/2869592-remove-update-warning-7.patch'
Hope this helps!
Fixed
5.0
Code