I'm trying to get the media.module to work for me but the instructions are somewhat unclear to me at one specific step. The line in the install.txt file says:

2. Patch the modules/upload.module file using the file upload.module.patch.txt

How do I do that? Is there some sort of command line or something that I should run - which, btw I don't know anything about, I don't think we have shell access to our account, so barring that - how can I do it?

I have all the other parts of the install done and -something- happens when I run the module, but it is not working as intended.

If anyone had a moment to try it out, please do:

http://www.cctvcambridge.org/drupal/

Comments

Dublin Drupaller’s picture

hi Sean,

There are handbook pages for applying patches..but for the life of me I have never been able to get it working. I work on a PC a nd there are no simple to use patching programmes out there...so when I'm stuck..I tend to open up the module that needs patching alongside the patch file and edit the module manually, line by line...hoping for the best that no mistakes have been made.

What stumps me is that why don't people attach the patched module along with the patch...i.e. "here's the patch file...and here's the latest version of whatever.module with the patch applied."

unless I'm missing something very obvious...patching modules is not an easy task if you're on a PC and the patch is more than a few lines.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

micha_1977’s picture

i say its time to get the patch thing working even for the not-geeky users out there =)

atm ill look for a patch tool which runs either as commandline or not, starting cmd.exe or providing a .bat for windows users shouldnt be a big problem

-micha
work in progress with Drupal 4.6: langmi.de

Dublin Drupaller’s picture

hi Micha..

I agree..just downloaded winmerge...which looks handy...but don't have time to check it out properly. http://winmerge.org/

If you come across any neat windows based gui for patching files..please post back up here.

Cheers

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

micha_1977’s picture

i read the documentation...

17.7.2. Can patches be applied using WinMerge?

No. Patch tool from GnuWin32 project can be used for patch applying since WinMerge produces GNU/diffutils compatible patch files. See above question.

-micha
work in progress with Drupal 4.6: langmi.de

frjo’s picture

"Cygwin is a Linux-like environment for Windows" http://www.cygwin.com/

I don't use Windows myself but I have heard good things about Cygwin. With it I believe you can to use the normal diff and patch commands.

The reason developers prefere to distribute patches instead of the complete file is because it's a lot more efficient and convenient.

If bicycles had three wheels it would be much easier to learn how to use them. Two wheels on the other hand are a lot better in the long run and well worth the extra learning time.

Dublin Drupaller’s picture

can you point me to the three wheeled bicycle of patching?

Most kids start there when learning how to ride a bike..

patches are convenient for programmers but not for non-programmers..I think drupal should strive to be as friendly as possible....for example, if someone like yourself, who sounds like an accomplished unicycler, could lash together a simple patcher.module that has a text field and a selection box for the module to be patched, it would be useful for those, like me who are unable to find that three wheeled bicycle..

the lack of availibility of windows based patching programmes suggests it might be easier to do it server side..and thus a patcher.module might be an idea..

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

robertdouglass’s picture

Using Drupal to patch its own code would be a bad idea. A Drupal patch module has been generally frowned upon and I personally would consider it dangerous. Besides, after you read the documentation for patching, you'll see that if you can specify a source file and a patch file you have all the skills needed to run patch on Cygwin.

Hopefully the patch for the media module will make it into core. It is a good idea and everybody who has looked at it (and said anything) has agreed.

- Robert Douglass

-----
If this helped you, please take the time to rate the value of this post: http://rate.affero.net/robertDouglass/

www.hornroller.com, www.robshouse.net

robertdouglass’s picture

Hi Sean,

I use Eclipse for patching (Eclipse.org).

- Robert Douglass

-----
If this helped you, please take the time to rate the value of this post: http://rate.affero.net/robertDouglass/

www.hornroller.com, www.robshouse.net

micha_1977’s picture

eclipse is a bit overkill for the normal user who wants to patch once in a while

-micha
work in progress with Drupal 4.6: langmi.de

seaneffel’s picture

I believe I correcty made the changes in the upload.module the way a patch would have, but then I got a blank page of death when loading the drupal site.

Here is a stab in the air if anyone is kind enough to lend a hand...

http://www.cctvcambridge.org/uploadmodpatch.zip

Could anyone with a free ten minutes download this file, which contains the two files (upload.module and upload.module.patch.txt) and run them through your ringer. You could email back the files to sean@cctvcambridge.org, and I would worship the code you write upon. Anyone can do?

I'll post this thread to the Media.module page and see if we can get the properly patched file -included- with the media.module package for the future.

seaneffel’s picture

Back to this request, if anyone can do this simple patch job for me, you will be my hero.

Sean
Cambridge Community Television
http://www.cctvcambridge.org
http://www.cctvcambridge.org/drupal (beta site)

micha_1977’s picture

maybe i found a way to apply patch files for winxp users, but do not overread the downsides of this solution

PLUS

i checked, if the patch applied correctly, but i did not tested the module after the patch

what do you need ?

the "patch" program patch.exefrom
win32 ports of tools
or
sourceforge project file list

grab the .zip or the binary (.exe), the last one has all the docs too

what to do before i try to patch ?

you need to look into the patch file to check the version of the original you have to apply the patch to

in this case (media module) the upload.module.patch.txt says

RCS file: /cvs/drupal/drupal/modules/upload.module,v
retrieving revision 1.34

so the patch is for the version 1.34 of the upload.module

where to get the needed version of the original ?

go to cvs.drupal.org

in this case choose "drupal" then the "modules" directory and now the "upload.module"

you can now scroll down to the version you need and click the "download" link for the "download" link for the version 1.34 of the upload.module

i want to patch dammit !

ok first, make your life easier and copy both files (patch + original) to the /bin directory of you patchprogram installation (the directory where the "patch.exe" lies in)

next you need to run the program with the following

patch --binary (original filename) (patch filename)

the --binary option is necessary, otherwise it will spit out an error :-)

i cant get the program to run

yeah its somehow a step back into to the good ole win95 times *cough*

you can get it running with

start cmd.exe

Command-line tools must be run at the prompt of the Cmd.exe command interpreter. To open Command Prompt, click Start, click Run, type cmd, and then click OK.

commandline commands

and fight your way through all the commandline commands to reach the directory your patch.exe is in (with "cd .." and such)

should be possible to create a .bat file for this, but atm ive no time for that

id like to hear if it worked for you =)

-micha
work in progress with Drupal 4.6: langmi.de

Bèr Kessels’s picture

One thing is that if you cannot patch, its too diffucult for you, and you shoul simply stay away from it. Sounds rude? I dont agree, since people without a degree in nuclear physics should simply not want a powerplant in their cellar, they should do with what the cable-company has to offer. REally, ppatching is not that hard, but if you aer not willing to learn how it works, then you best stay wit what Drupal does without patches.

the other thing is that click-n-point patch systems will never really work. The only way to grasp the concept of patching, is to get to know its guts. PAtching -again- is really not hard, but klick-n-point systems will keep you away from the contcept of patching, which is all what its about.

So I suggest you fire up your printer, google for some good introductions in patching, and print them for some nice bedtime reading. (and post any good urls on drupal.org)
---
Next time, please consider filing a support request.

[Bèr Kessels | Drupal services www.webschuur.com]

venkat-rk’s picture

Well, quite often, the patches represent improved versions of modules and not being able to apply patches (for whatever reason) means these enhancements are denied to those users.

Flexinode (this is just as an example) module has a release date of 11/03/05, but the changelog mentions 4.6 fixes on 15/4/05. As a non-programmer, I don't know if the cryptic '4.6 fixes' include the solution to the flexinode security hole issue. If not, the only way that I, as a user, can safeguard my drupal install is to apply the patches manually.

I don't know how CVS works, but, does it add a lot of overhead that prevents Drupal from automatically updating a patched module and providing the patched version for download instead of leaving the users to fend for themselves?

If this is already being done, is there a way for non-programmers to get the details of the patches? Not all module maintainers seem to keep the changelog updated, no doubt due to shortage of time.

seaneffel’s picture

If developers want their modules put in circulation then they had best include pre-patched files or make up some clear instructions on how to apply a patch. Its foolish not to do these things. They are limiting the depth and scope of the project, and missing opportunities to let their work to grow and evolve. The intructions in the media.module to, "#3. Patch upload.module with upload.module.patch.txt. Period." is totally insufficient.

Whats more, our entire office works on a mac platform. The windows patch app solutions work great I'm sure, but not for us.

Sean
Cambridge Community Television
http://www.cctvcambridge.org
http://www.cctvcambridge.org/drupal (beta site)

frjo’s picture

Whats more, our entire office works on a mac platform. The windows patch app solutions work great I'm sure, but not for us.

Then it's easy for you. Mac OS X foundation is BSD Unix so just open up the "Terminal" and you will have access to all the normal diff, patch etc. commands (Apache and PHP is also built in and MySQL easy to add).

seaneffel’s picture

And those normal diff, patch, etc commands would be... ? I don't know this stuff, so if one could point me to some documentation on how to use it then I would be greatful.

Sean
Cambridge Community Television
http://www.cctvcambridge.org
http://www.cctvcambridge.org/drupal (beta site)

robertdouglass’s picture

on a *nix system you can type any of the following to get usage instructions for commands:
man diff
man patch
diff --help
patch --help

You'll need to know how to get to the command line and I can't help you on OSX since I've never used it.

- Robert Douglass

-----
If this helped you, please take the time to rate the value of this post: http://rate.affero.net/robertDouglass/

www.hornroller.com, www.robshouse.net

sepeck’s picture