Using composer for forked drupal contrib module

Note Statistics

Note Statistics

  • Viewed 125 times
Sat, 03/14/2020 - 18:43

Let's suppose that we need to patch and fork the pathauro module.

  1. Fork pathauto to your user or organization. For example to import to a GitHub using the import tool.
  2. Add your repository to composer.js
"repositories": [
 {
     "type": "vcs",
     "url": "https://github.com/youruser/drupal-pathauto"
 },
 {
     "type": "composer",
     "url": "https://packages.drupal.org/8"
 }
]
  1. Use your new branch or tag in the require section. When using branches, prefix version with dev- . For a branch named feature-one the require section would look as below
"require": {
  "drupal-pathauto": "dev-feature-one"
}
  1. Run composer update drupal/pathauto to update the module to the forked version.
Authored by