Applying Patches in Drupal on your Mac via Terminal

August 11th, 2011 admin Location: Raleigh, NC, Topic: Web Design | Digital Media

[private]

Quick little tutorial here. Let’s get to it. Let’s say that you have a Drupal website running in your web server in your Mac -for example with MAMP. And lets say that you have installed a couple of contributed modules manually or through Drush. However, the module developer found a bug and fixed and instead of updating the module itself, they decided to issue a patch for you to apply.
Now you may ask, that is great stuff, but how do I install the patch for that particular module? Don’t worry it is simpler than you may think.
1. Find the URL of the patch.
The first step is to find where the patch resides. Sometimes this is going to be directly in drupal.org path.

2. Open up Terminal in your Mac and navigate to your Drupal installation.
3. Drill down to the module’s directory, if it is a core module you are about to patch, or to the sites > all > modules folder if it is a contributed module.
4. Navigate to the folder of the module and type the following command:

curl -O http://www.drupal.org/the-location-of-the-patch.patch

5. This command would download the patch to the same directory as your module.
6. Then to apply the patch simply type the following command:

patch < the-name-of-the-patch.patch

That’s it. Now you should see the application of the patch in your command line, and you are done and set.

I hope this helps everybody out there wanting to learn how to apply patches in Drupal in your Mac OS X terminal.
[/private]

About the Author

Alex Centeno MBA., is an international creative director and digital media strategist. Currently residing minutes away from the Research Triangle Park (RTP) - North Carolina, and with over 10 years of interactive marketing training and experience, Alex leads Merkados' international clients to maximizing their online business strategies. One of Alex's biggest strengths is his world-class capacity to effectively combine interactive marketing, digital media design and web development.

You may find further information about Alex Centeno MBA. at: and Twitter.

Sobre el Autor

Alex Centeno MBA., Es un director creativo y estratega de medios digitales reconocido internacionalmente. En la actualidad reside a tan solo minutos del Research Triangle Park (RTP) - Carolina del Norte, y con más de 10 años de entrenamiento y experiencia en marketing interactivo, Alex lidera a los clientes internacionales de Merkados™ para maximizar sus estrategias de negocios en línea. Una de las mayores fortalezas de Alex es su capacidad global de combinar de manera efectiva, mercadeo interactivo, diseño de medios digitales y desarrollo web.

Para más información sobre Alex Centeno MBA. puede visitar: y Twitter.