Lin Clark

How to Start Contributing to Modules on Drupal.org

Submitted by Lin on

Drupal Dev Notes is a new series of screencasts that I'm starting to share all of the Drupal development know-how, habits and tricks that I wish I'd learned the easy way.

The first of these is how to contribute to projects on drupal.org. The best way to get started with contrib is by making small fixes to other people's projects. This way you can learn Drupal coding standards and best practices gradually, with help from other Drupal developers. It can also be really fun :)

UPDATE: I highly recommend reading How to Solve All Your Problems first, especially if you haven't been active on the issue queue before.

Link to video

  1. Install Git
    There's installation instructions for Git on drupal.org. If those don't work for you, try http://help.github.com/ and then follow Randy Fay's screencast to hook it up to Drupal (or read the instructions on drupal.org).
  2. Choose issue
    You can either look at issues on a specific project, or a great way to find easy ones is to look for the Novice tag. You want the issue status to be either 'active' or 'needs work'.
  3. Download project
    Each project has Git instructions. Choose the latest branch, which will probably be 7.x-?.x or master. Click 'Show' and copy the command. Then run the command in the sites/all/modules directory.
  4. Find bug
    egrep -r hook_node_info simpletest_example/
  5. Make branch
    git checkout -b [short description]-[issue-number]
  6. Fix code
    Refer to coding standards for code style.
  7. Create patch
    git diff > [description]-[issue-number]-[comment-number].patch
    Randy Fay has a great post about patching with Git.
  8. Upload patch for review
    People often use Dreditor to review patches.
  9. Make revisions
    Once you get feedback, you can make revisions to the patch.
    Refresh your repo using 
    git checkout [version]
    git pull

    Then re-apply changes:
    git apply -v [patchname].patch

Other Links

Comments

Thanks

Thanks for writing this up Lin. I've been wanting to help out more by contributing patches but didn't know where to start - I had no idea about the novice tag.  This is a good first step.

thanks,pete