Applying Patches - NCIOCPL/cgov-digital-platform GitHub Wiki
- ¡¡¡¡¡NEVER RUN `composer update` EVER!!!!!
- ¡¡¡¡¡NEVER try to update a composer package without having done an install first!!!!!
Note: This is for applying to patches to third-party modules. For our code, just fix it directly. 😀
Steps to Apply a Patch
To add a patch to drupal module foobar:
- create a branch from
develop
. composer cgov-clean && composer install
- Download (or create) the patch file.
- Place the patch file in the patches directory, with a sub-directory structure matching the package name. e.g. Patches for drupal/core belong in patches/drupal/core and patches for drupal/paragraphs belong in patches/drupal/paragraphs.
- Add the entry to the “patches” section of composer.json
"extra": { "patches": { "drupal/foobar": { "Patch description": "local path to patch" } } }
- Include the patch's download URL (if applicable) in the description (e.g.
"12345 : Reverse module polarity (https://www.drupal.org/file/issues/2023-09-27/polarity-12345-17.patch)"
)
- Include the patch's download URL (if applicable) in the description (e.g.
composer cgov-clean && composer install
composer update --lock
- Launch container
blt cgov:rebuild-feq && blt cgov:reinstall --no-interaction
blt test