- Given I have Drupal 9 composer installation with
composer-patches
plugin - and given a contrib module with a stable v8 release, but no v9 release (not even dev branch)
- and given that contrib module has a working v9 patch in the issue queue
is there any method to install that module + patch in composer? Even if I manually add both, the package and patch, to my composer.json
, I still can’t require
or update
this module with composer due conflicting versions. I really want to avoid duplicating /contrib
code into my project’s /custom
codebase. My current workaround is:
- forking that module to my own, private git repo
- applying patch there
- creating a new
composer.json
in my private git, and changing the package vendor to mycustom_private_vendor
- adding my private git as VCS repo in the D9 project’s
composer.json
- and then
composer require custom_private_vendor/contrib_module
This fulfills my goal of not duplicating the contrib module in my project’s custom codebase, but every time I do this I feel the urge to wash my dirty hands.
Is there something more elegant like composer require drupal/contrib_module --apply-patch-first
or can I somehow target drupal.org’s git with a specific patch included?