Dear forum,

I would like to apply this patch of update #2 to the book module but I have never done a patch before and I read the diff and patch thread but it meant nothing to me.

I use a third party server and don't have shell access so I read something about manually changing the script but looking at the original book module I haven't a clue where the patch should go.

Could someone please advise as to how I should go about applying this patch without jeopardizing the book module that is working beautifully at the moment.

Thanks

FrancisQ

Comments

chx’s picture

If you can not do it remotely, then do it locally. DL the Unix utils for Win from http://unxutils.sourceforge.net/ and simply type patch book.module <patchfilename and upload the patched file back.

--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

AndrewE’s picture

Chx thanks for the response. I dld the utility but couldn't figure out where to type that command...i guess i'm out of my depth here...

The Green Room

sepeck’s picture

from the command line.
copy an unmodified version of the file to a directory, copy the patch to the same directory. Run the patch program. Test.

-sp
---------
Test site...always start with a test site.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

AndrewE’s picture

I got 2 folders "bin" and "usr". In the "bin" folder there's just an icon that I clicked and it brings up a dos window called "sh.exe" in the dos window it's written "ALPHAONE #" I entered the following next to it
"patch book.module < book_19_1.patch" and it comes up with command not found.

The book.module and the patch file are both placed in the "bin" folder btw.

So I can't figure out how it works, i'm not even sure I'm using the right programme but I couldn't find any others to open so i guess it must be.

The Green Room

sepeck’s picture

you need to make sure you have the patch program and you need to make sure that the path to that patch program exists.

-sp
---------
Test site...always start with a test site.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

AndrewE’s picture

Does anyone know an alternative to applying a patch to a module?
Or is Chx's suggestion the only way?

Thanks all.

FrancisQ

The Green Room

killes@www.drop.org’s picture

You can always apply a patch manually. Open the file to be patched and the patch in a texteditor. The patch consists of lines starting with - and those with - (and ones without either, those are only there to get the context). The lines with - needs to be removed from the file, the lines with + need to be added (and the +es removed).

But a word of wisdom: The patch is development work in progress and if you can't figure out how to patch a file you should not bother with it.
--
If you have troubles with a particular contrib project, please consider filing a support request. Thanks. And, by the way, Drupal 4.5 does not work with PHP 5.

AndrewE’s picture

Thank you all for posting your help I really appreciate it indeed.

I tired doing it manually but got errors when I uploaded the patched file to my site so it must have been wrong, I tried again with the software mentioned above but couldn't get any joy with paths or any of that.

What I wanted to do was really quite simple, I just wanted the book module block to be displayed on every page of the site as opposed to just the book node pages. That was the purpose of the patch.

I'm wondering if the latest book.module in the CVS has this funtion included already? Does anyone know if that is true?

If it was already incorporated then I guess I could just upload the latest book.module? Is this phony logic?

Thanks,

FrancisQ
The Green Room

andremolnar’s picture

Not in CVS yet ;-) - and another patch is required to make this work.

If you are installing the latest patch from http://drupal.org/node/14120 (feb 6th version) you will also need to install the patch to menu.inc found at http://drupal.org/node/15198 (which I just updated so it is current).

It is also important that your CVS drupal install is up to date - because recent changes to block.module and the {block} table impact on the patch. So, get a clean copy of CVS and make sure to run update.php if you haven't already done so.

andre

andremolnar’s picture

re-reading your original post you mentioned attempting to patch with 'update #2' - always patch with the most recent update (e.g. #73) - older patches are very often (i.e. almost certainly) out of date (i.e. wont work) when patching against CVS.

andre