So I am using the image_attachment module (part of the image module). I love the way it works, and it will be perfect for my application. The only thing I need is multiple image attachments. There is a patch for this at:

http://drupal.org/node/81102

The only problem is the patch is made for the HEAD version which has been updated for Drupal 5. Since I'm on 4.7.4 and am unfamiliar with the changes to version 5, I am wondering what my best approach to this is.

My first idea was to check out a new copy... apply the patch, then diff the current head to the 4.7.4 version and then attempt to apply that patch to bring it back to 4.7.4 compatibility.

Whether or not this will work depends on how different the module version are, and whether the multiple attachment patch requires and new Drupal 5 features. Are there any references on API/hook differences or other reference material for backporting a patch?

If I need to I suppose I could go with an image gallery instead of image attachment, but frankly I think the image_attachment is a better fit.

Comments

johnalbin’s picture

The patch system tries to be as flexible as possible. So you might still be able to use the 5.x-dev version patch on a 4.7.x module.

Try patch -p0 < v5.patch on your 4.7 module and see if it works.

If it fails, you will see error messages like "Hunk #1 FAILED at 422" when applying the patch. If it works, you will probably only see messages that say something like "hunk #1 succeeded at 422 with fuzz 1 (offset -8 lines)" which you can safely ignore.

Good luck!

(BTW, the patch file is created using diff -up so if you understand diff output, you could also try reading the patch directly.)

  - John (JohnAlbin)

dasil003’s picture

Yeah, I tried that already, but unfortunately it's a pretty mammoth patch. After all we're talking changing a 1-1 relationship to a 1-n, so almost every function is changed, and probably most of the lines. The hunks are all funky, and the changes for v5 appear pretty sizable as well. I guess I better just sit down and hack at it for a while. Maybe I'll have to use a gallery.