This is a continuation of patch-related discussion in #330740: "Other" option in select lists for text entry.

See: What is a patch? and Applying patches on Mac OS X

tawebworks, you have saved the patch file as RTF instead of plain text. The easiest thing is probably to click the link to the patch file from the Drupal web site and choose Save Page As.... Or in TextEdit, under the Format menu, choose Make Plain Text. Also make sure you are in the correct folder in the Terminal.

Comments

tawebworks’s picture

Liam, I sincerely appreciate your attempts at helping this simple minded soul. The problem I'm facing now is fundamental. Mac's TextEdit doesn't offer an option to save as text. Options are RTF, RTFD, HTML, Web Archive, odt, docx, doc, and Word 2003 XML format. When I make the attempt to save as .txt in Word (using their "Save as Text" option), I get a line break problem.

When I highlight the link and "Save As", the resulting webform-select_or_other_1.patch, I get this from terminal: *** Only garbage was found in the patch input.

What next?

tawebworks’s picture

As a result of my aforementioned problem, I downloaded "Textmate", a program from http://macromates.com. It allows me to save as a .txt file. NOW, when I run the patch within Terminal, I get this:

[Tami-Whitesides-Computer-10:~] tamiwhit% patch < /Users/tamiwhit/Desktop/websites/Meck\ Promise/sites/all/modules/webform/components/select_or_other_1.patch
can't find file to patch at input line 3
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|--- webform/components/select.inc 2009-03-04 00:05:11.000000000 -0500
|+++ webform/components/select.inc 2009-08-18 13:09:53.000000000 -0400

I know this is elementary for you, but please help!

dman’s picture

Patches are usually generated relative to their project. Core pathces are provided relative to drupalroot. I'm not sure of the rule for contrib, but I usually assume them from the 'modules' directory. (mayb it's supposed to be inside the module dir itself. Hm.
So move into the module dir and try that.

If you see the general patch docs it recommends using -p0. That does something about allowing for you to be in a different directory, I think. That's what the error message apout -p is

Anyway, I'd first try:

cd /Users/tamiwhit/Desktop/websites/Meck\ Promise/sites/all/modules/webform
patch -p0 < components/select_or_other_1.patch

Otherwise go into the actual dir and try there.

cd /Users/tamiwhit/Desktop/websites/Meck\ Promise/sites/all/modules/webform/components/
patch -p0 < select_or_other_1.patch

... it depends on what the creator was doing when they made the patch.

tawebworks’s picture

...kind dman.
I got it working!
I appreciate your help!

akalata’s picture

Liam - thanks for the patch and for being so patient answering questions. This is the first time I've patched anything but I'm gradually becoming more familiar with Terminal commands.

I had the same problem as Tam where the patcher couldn't find the file to be patched, but the patcher prompted me to specify the file name so I typed in "select.inc" and it worked just fine.

v8powerage’s picture

You don't have to use terminal at all if You have TextMate

Go to:

Bundles --> Diff -> Apply Patch to Files

My ver. is: Version 1.5.7 (1436)