To sustain this free service, we receive affiliate commissions via some of our links. This doesn’t affect rankings. Our review process.
So you’ve got everything working except for one nagging little bug that’s keeping your site from rocking the world. This is normally where patches come in. There are two kinds of patches – those that eventually get rolled into the production version of a module, and those that are temporary hacks to fix a longer term issue. I would recommend only using those you feel will eventually be rolled into the code, and if possible, avoid patches entirely for compatibility reasons. Too often a patch will fix a temporary issue that will later be solved in a different way and render your “patched” database structure obsolete. That being said, here’s how to patch a Drupal module in Windows:
Cygwin is a Linux-like environment that runs in Windows. The dll (cygwin1.dll) acts as a Linux API emulation layer giving you basic Linux API functionality. The complete download comes with a collection of tools that provide a Linux command prompt look and feel. As a first step, you’ll need to download and install the latest version of Cygwin.
You can install the default packages, but make sure you include the “patchutils” package under the “Devel” section.
Common Cygwin Commands:
Here’s a list of the commands you’ll need to access the patch directory:
- ls -al — lists the contents of your current directory
- cd .. — moves you up to the parent directory (note the space between cd and .. if you come from a DOS background!)
- cd foldername — moves you to a specific folder visible from your current directory
Steps to Patch a Drupal Module in Cygwin
Here are the basic steps you’ll need to follow to patch your module:
- Copy the patch file and original module to the same directory, one you can access via the Cygwin commands above.
- Run this command:
patch filetobepatched < patchfile or patch -p0 < patchfile
Voila 🙂 Post any questions or comments below.
If you’re using Windows Visa, run Cygwin as an administrator. You’ll also need to uncheck the “read only” flag on files you modify, and adjust permissions (under the security tab) to allow full access for your user. Otherwise, you’ll have trouble copying and uploading files – you’ll get “permission denied” errors.
Disclaimer: This website contains reviews, opinions and information regarding products and services manufactured or provided by third parties. We are not responsible in any way for such products and services, and nothing contained here should be construed as a guarantee of the functionality, utility, safety or reliability of any product or services reviewed or discussed. Please follow the directions provided by the manufacturer or service provider when using any product or service reviewed or discussed on this website.