Looking for a reliable and affordable Domain Name Registrar? Look no further than Dotster. And for a limited time, we're able to offer our visitors a buy one domain name, get one free promotion. Click here
to take advantage of this offer.
Constant Contact has been in business since 1996 is one of the most reliable and trusted email marketing services around. Click here to activate your free 60 day trial courtesy of CWD Community.
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.
Here's a list of the commands you'll need to access the patch directory:
Here are the basic steps you'll need to follow to patch your module:
patch filetobepatched < patchfile or patch -p0 < patchfileVoila
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.
All Content © 2005 - 2010 Contract Web Development, Inc. All Rights Reserved. Privacy Policy | Terms of Use | Powered by Drupal
Failed to work for me
Hi, it didn't work for me and gave me a hideous error saying "3 out of 4 hunks failed, saving rejects to file". Any clue about it?
Version specific patches
Drupal patches are very version-specific. Make sure you're applying the patch to the module that matches the version # of the patch. If you're still seeing errors, try the patched module anyways - sometimes errors are thrown and the module still works.
Can't copy patch files in Vista?
Thanks for the Cygwin/ Drupal tutorial. I've got this installed on Windows Vista, with UAC turned on, and I was able to patch a file successfully. However, I can't copy it over to my Drupal directory, even if I use the bash "cp" command from within the bash shell. Any ideas?
Windows Vista security
Great question - run Cygwin as administrator and then update permissions on your patch file to allow full access to your user, and uncheck the "read only" box. I've updated our article to reflect this new information.
Patching Drupal modules
Excellent resource for us Windows users - thank you! I've been having to wait for patches to be rolled in to official releases. Not anymore - now I can apply updates right away. Thanks!!
Setting file permissions using Cygwin
Thank you for the link to cygwin. One question, though, how are file permissions set using Cygwin?
Thank you.