Steps
-
find a patch URL
-
check the module page on the drupal website, people usually provide those in issues over there
-
-
add cweagans/composer-patches
-
in root -> require: "cweagans/composer-patches": "^1.7"
-
in root -> config -> allow-plugins: "cweagans/composer-patches": true
-
-
add the patch to composer.json -> extra -> patches
Example
"extra": {
"patches": {
"drupal/core": {
"Fix for disabled text formats not displaying in GUI": "https://www.drupal.org/files/issues/2022-12-09/2502637_110.patch"
}
}
}
-
composer install
Notes
If for whatever reason Composer refuses to apply the patch, delete the package folder and try again.