Submitted by Andy Brown on Wed, 11/23/2011 - 11:46
Tim and myself have been working on a project this week, and the need to apply a patch to a module came up. We weren't able to find much in the way of documentation when it came to patching, so after teaching ourselves how patching modules works in Drupal (using a lot of trial and error), I've decided to share what we learned in hopes that it will help the next person that needs to learn it. Pay it forward, and all that.
Let's do this. First, here's what you'll need.
- The patch file, obviously. Make sure it ends in
.patch and not something like
.txt. Download it locally.
- Shell access to your server. This may or may not be a big deal. If your websites are hosted by a hosting company, you may need to ask for shell access (that's what I had to do on my personal server).
- An FTP program, or some other way to get your patch file onto the server.
Alright, we've got everything we need. Now here's how we patched one of the modules we were using.