I am facing an issue wherein I have added a single patch in my composer.json under "extras"

   "patches": {
            "drupal/field_validation": {
                "Declaration of (...)FieldValidationRuleAddForm::buildForm": "https://www.drupal.org/files/issues/2941006-php-incompatible-buildform-signature.patch"
            "drupal/ubercart": {
                "Not_yet_ported (missing)": "https://www.drupal.org/files/issues/2020-05-28/ubercart_remove_not_yet_ported.patch"
        "enable-patching": true

After adding the patch under composer.json I ran

composer install

but still it does not apply the patches listed.

1 Answer 1


The solution was

composer require cweagans/composer-patches

we need to be sure that above package is included

After adding the above I was able to add patches via composer.json

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.