How to apply a patch to a drupal Module from Windows

I recently had to patch my Mollom Module that I have got installed on a Drupal installation. I just wanted to share with other folks as to how you can do this, especially from a Windows machine when you do not have access to a Linux or Unix command prompt to make changes or you do not have access to the patch utility.

In our example below we would try to patch the Mollom module with a patch that is avaialable at . All this patch does is modify the module file to make it aware of the Guestbook form, so Mollom can spam protect your site's Guestbook as well.

Here are the steps:

- Download the "Patch" utility for Windows from Sourceforge at

- Run setup.exe and choose all defaults, this would create a C:\Program Files\GnuWin32\bin folder on your machine and a start menu entry as well.

- Connect to your Drupal website using an FTP client, and naviagate to your Mollom module directory (this is usually /sites/all/modules/mollom directory

- From your Mollom module directory above, download the "mollom.module" file to your C:\Program Files\GnuWin32\bin directory

- Download the Mollom Patch from also to the C:\Program Files\GnuWin32\bin folder

- Open up a Windows command prompt (by clicking Start -> run -> cmd and hit enter)

- Change your directory to the GNU Patch program directory on the command prompt by giving the command cd C:\Program Files\GnuWin32\bin

- Patch the Mollom.module file locally by typing "patch < NameOfThePatchFileYouDownloaded" without quotes

- It would confirm that the file has been patched succesfully, and would also create a backup copy of the file with a file extension of .orig

- Finally, Upload this patched mollom.module file to your web server to the /sites/all/modules/mollom directory, overwtiting the the file that exsists there. For backup purposes, also upload the .orig file that the patch process created.

Mollom should now be patched.

Although this example shows how the Mollom.module was patched, its the same process for patching any other drupal module files as well. The .patch file you download is actually a text file, if you read the file it would tell you exactly which file in your module directory is it patching and what it is doing! Good Luck!

An interesting theme for us


Reply to comment |

Since your windows are very vulnerable to this type of threat, you may want to consider cutting sheets of plywood and placing them over all of the windows in your house until the storm has safely blown over. Another point that is often not taken into consideration is the source of the water. Because of the speed that mold can grow, especially when temperatures are warmer, fast action is critical.

Reply to comment |

I am sure this article has touched all the internet visitors, its really really pleasant paragraph on building up new weblog. my website :: [url=http://www.CLASSICSUNGLASSES.ORG]Luis[/url]

Reply to comment |

Hello, I had been researching the net & I discovered your web site. Keep up the superb work. I’m creating a little issue. I can’t subscribe your give food to. I’m using search engines reader by the way. When I research your RSS feed it puts upwards a ton of garbage, is the concern on my own reader? Fantastic blog! We definitely adore how it’s simple on my personal eyes plus the data are well written. I will be wondering how I might be advised whenever a new post has been created. I have bought to your rss which need to do the trick! Possess a nice evening! Do you treatment if I reference part of this upon my website if I submit a reference to this web site? Thanks for the helpful information! I wouldn’t have found this kind of on my own! Just thought I might comment and say nice theme, did you design it for yourself? Really looks awesome! I just additional this web site to my favorites. I enjoy reading your posts. Thank you! Is it fine to put some of this upon my web page if I add a link returning to this site? I have been looking to submit about something such as this upon my site and you set it up an idea. Many thanks. Thanks for the weblog loaded with so many information. Visiting your blog solved the problem to get a few things i was looking for. Maintain working, good post! This was the one thing... I had to know. Generally I don't post on blogs... I would like to state that this submit really pressured me to do so! Good publish, adding this to my own blog right now, thanks. I really like your blog style, can you figure out the name of it or in which you downloaded this? I therefore enjoyed every part of this web site and I’ve book marked your blog to keep up with the new topics you will post in the future. Beneficial site, although I would love to see a a bit more media! Is there a purpose of this post in the event you don’t mind me asking? Have you any idea if will probably be worth buying a itemizing in a general directory ? May this help my weblog ? Great web site I’m happb I came onto it via my friend’s blog. The internet marketer of this web site has completed a very very good job the following and I is going to be back on a typical foundation for new subjects. Great info indeed. I’m the following to see some good comments! My personal girlfriend may be looking for this update! Glad I noticed this on google! Very useful post. Your current Blog style is awesome as well! Searching more to something like this particular... I just done mine and i also was looking for several design ideas and you gave me a few. Is there a purpose of this informative article if you don’t thoughts me asking? The website was developed by an individual? I really enjoyed this site. I type of agree on the main things, but not all. I really enjoyed reading this site, this is great blog. Really your creative writing abilities has influenced me to start out my own website now. Never believed that it was this simple in the end. I had put in a good deal of my own time looking for you to definitely explain this kind of subject obviously. I’m happy I found this kind of weblog, I couldnt find any information on this subject material prior to. I think youve created some actually interesting items. Dude, you should tell me that youre planning to publish a much more. I notice you have not written yet another weblog for a while? I would like to be able to thank you for the particular efforts you get in producing this article. I’d prefer to thank you for the efforts you've created in writing this post. Just a quickly hello and also to thank you for talking about your ideas about this page. Great to be visiting your weblog again, that continues to be weeks for me. I’ll be back as soon as again inside the possibility to examine out your blogposts down the road. Great to become going to your weblog again, it's been months for me. Love your website, will be stopping back again. Sources such as the one you mentioned right here will be extremely beneficial to myself! I’ll publish a hyperlink for this web page about my personal weblog. I just could not leave your site before telling you that I really enjoyed the particular useful information you offer to your visitors… Will be back shortly to check up on new articles Site continues to be added to my personal RSS feed with regard to later exploring. Keep to concentrate your level, this is nice blog. Nicely, its exactly about knowing what’s proper and what’s wrong. Everytime Someone said your posts I feel as if your writting is improving, see it from the day one. Check out your program code or something. There’s any browser incompatibility with your website. I’m here to see the right comments! Hmmm, this site won’t load properly about my Ipad. Might I use the main information from the post above if I provide a backlink to your site? I recommend to you to see on a site, with a variety of posts on a theme interesting an individual. Bless you for your blog post, that’s a few fairly practical information. I'll be back to proceed through more, always keep publishing. Thanks for putting these posts up.This is EXACTLY what I’ve been searching for. Keep running a blog. Anyway, many thanks and I look forward to posting again sometime! The actual clearness within your post is just spectacular and i also can believe you are a professional on this topic. His topic is good, long time I discover this topic and I think it is here, thanks guys .. I’ll save this page... Appreciate sharing. This is important. Thanks for sharing this article. My companion and i actually just like your own article with your current internet site all in all! Most of us require a lot more this sort of webmasters just like you on the web and also significantly fewer spammers. Excellent article! How long have you been running your website? This has been interesting but how do I bookmark this kind of? I tried Digg but have i got to sign up initial? What a wonderful post! Thank you for sharing this on your website. I agree using the author that individuals need to reveal the knowledge we gain! Well written post, nicely researched as well as useful for me in the future. Intriguing thoughts right here. I appreciate a person taking the time to share them with all of us. I desired to give thank you for this amazing read!!! We additional to be able to my book marks, thanks person! That is exactly how i feel about it. It’s people like you which make my evening... It in no way ceases in order to astonish me that, using a bit of added browsing online, you can land on many of the most unique blogs. Pretty good publish. I just stumbled upon your blog and also wanted to point out that I have really enjoyed reading your blog posts. I’ll be subscribing in your feed and I hope you publish again quickly. I’ve considered several web firelogs and I can for sure say that this the first is my favorite . This can be a great launch, Ill be back again down the road to have a look at other articles that you have on your own website. Hello there,guys,your site is really excellent! I like that. I truly adore the submitting along with your present site all in all! Your current Weblog style rocks as well! Would be great to understand where My partner and i are able download it. We're a group of volunteers and also starting a new initiative in our neighborhood. This post provided us all with valuable information to help us get going. You have done a remarkable job! appreciate your fantastic article and also blog that makes my day... This really is my initial visit to this blog. I am contemplating starting a fresh blog within the same group. There are some intriguing points in this article but My partner and i don’t know if I see them all middle in order to center... I've bookmarked it for you to ensure that others should be able to see what you have to point out. You seem to know where you’re coming from, and i entirely agree. It's about time going to be a few boring old post, but it really compensated for my time Good stuff, thanks for posting. I was actually looking for something different and this site came up lol I’m also interested in affilate and search engine marketing. I’ve extra Your blog to be able to my favourites features and awaiting next posts. I am happb that I seen this site , the ideal info that we was searching for! I will be back on the typical basis for new subjects. The best artcle actually ! great title great outline and the weblog very interesting ! I'm new to your website and just invested about An hour and Thirty minutes reading. Is that this a blog? Where do you get the theme from? I appreciate you taking the time to share with you them with all of us. This post provided us with valuable information to aid us get started|.

Reply to comment |

They aid in balancing the ecology and break down organic components in the environment. So whenever any mold growth is spotted, immediate actions should be taken and the molds should be removed immediately. The mere existence of airborne mold spores in a home or business is not necessarily a problem.

not working for me but not throwing an error.

Hi, I have followed the instructions above but nothing seems to happen, when i apply the patch on the cmd window a new cmd window appears with "C:\program Files (86)GnuWin32\bin\patch.exe" in the title bar, but it does not display any text or do anything else. The original cmd window also doesn't do anything, other than move onto the next line. I dont think i have overlooked any of the steps above. Any suggestions?

Is that a 64 bit operating system you are working on

Hello Peter,

Is that a 64 bit operating system you are working on ?

Reply to comment |

Attractive element of content. I just stumbled upon your blog and in accession capital to assert that I acquire actually enjoyed account your blog posts. Any way I will be subscribing in your augment and even I achievement you get admission to constantly fast.

Do you need to do this

Do you need to do this differently on a 64-bit machine?

Reply to comment |

Before attempting any kind of black mold removal, first you have to know how to distinguish them from other types of molds. Some of the more common indicators that you might have trouble with your foundation include:. In certain situations you will notice that mold will grow again even after cleaning the infested area therefore you are required to use additional products such as paints and sprays to inhibit the development of mold.

Patcher giving error

Hi, thanks for this, it is exactly what I'm looking for. However, when I enter command prompt and type the command, i get this error: "patching file realname.module Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354 This application has requested the runtime to terminate it in an unusual way. Please contact the application's support team for more info." Any ideas? Obviously I'm trying to patch the realname module. Thanks

If anyone is searching and

If anyone is searching and seeing this error from patch, the difference is unix vs windows line endings. To solve, in the command prompt type edit yourpatchname.patch and then re-save the file, overwriting the existing one. That converts the line endings on your patch from windows to unix, and solves the terminating Runtime error.

If anyone is searching and

If anyone is searching and seeing this error from patch, the difference is unix vs windows line endings. To solve, in the command prompt type edit yourpatchname.patch and then re-save the file, overwriting the existing one. That converts the line endings on your patch from windows to unix, and solves the terminating Runtime error.

Reply to comment |

- If your car sits low to the ground then you need a jack and jack stands. The truth is, there are MANY variables that affect this decision, not the least of which is just how much trust you put in a synthetic oil to offer enhanced protection and possibly extended oil drains. According to the oil manufacturers, it is generally suggested that you use high mileage oil in any car with an engine that has over 75,000 miles on it.

Reply to comment |

In comparison to some dental visit, that is both costly in addition to time intensive, a house teeth whitening procedure is straightforward, effective and fewer time intensive. So if you have such prosthetics implanted, it is best to consult the family dentist first. Once the fitted tray is formed to your mouth, it should be able to hold the whitening gel against the surfaces of your teeth.

Extra switch

This post says you need --binary to get around that error.

The author for this article

The author for this article is currently away. I am sure you will get a response back as soon as they return, do check back!


I have exactly the same problem !

I have exactly the same problem !

I have used bynary, but it

I have used bynary, but it look to not work at the end anyway.. Microsoft Windows XP [Versione 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\matteo>cd ^V La sintassi del nome del file, della directory o del volume è incorretta. C:\Documents and Settings\matteo>cd C:\Programmi\GnuWin32\bin C:\Programmi\GnuWin32\bin>patch < 597654-theme.patch patching file Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354 This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. C:\Programmi\GnuWin32\bin>patch < 597654-theme.patch --binary patching file can't find file to patch at input line 42 Perhaps you should have used the -p or --strip option? The text leading up to this was: -------------------------- |Index: domain_theme/domain_theme.module |=================================================================== |RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_theme/domain_ theme.module,v |retrieving revision 1.16 |diff -u -p -r1.16 domain_theme.module |--- domain_theme/domain_theme.module 13 Jun 2009 20:02:40 -0000 1.16 |+++ domain_theme/domain_theme.module 7 Oct 2009 14:31:08 -0000 -------------------------- File to patch: patching file Hunk #1 FAILED at 238. 1 out of 1 hunk FAILED -- saving rejects to file C:\Programmi\GnuWin32\bin>patch < 597654-theme.patch --binary^A