I've taken a risk to implement filefield.module support, after refactoring and afterwards reusing, much of the upload.module-related code.
As I mentioned, I've redone attachments processing so that files now are not just overwritten but attempted to be compared by filename, size and time and considered unchanged if these properties match.
Every field of filefield type is now following the same logic.
Filefield implementation is probably buggy and incomplete (mainly, because I don't fully understand filefield.module internals to account for every possible scenario; one such case that comes to mind is the possibility to have multiple fields referring a same physical file - i even don't how to accomplish this via UI!).
Anyway, in my specific scenario this seems to work, so I'd like to share outcomes.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 20101013-drupal-subscribe-filefield,og_support.patch | 8.4 KB | esteewhy |
| 20101011-drupal-subscribe-filefield_support.patch | 7.73 KB | esteewhy |
Comments
Comment #1
esteewhy commentedComment #2
esteewhy commentedAdded OG field values remapping
Comment #3
miechiel commentedThe file field patch isn't working properly. If an item on the remote site doesn't contain a file the patch is downloading the complete frontpage of the remote website to set in the file field.
The file table and the files directory is growing with a huge amount of temporary files.
I am working on a patch..
Comment #4
ejohnson commentedI have the same issue as reported in #3.
#2 Patch fixes the problem with the file not attaching properly. However, if there's no file attached then it creates a file.
miechiel, did you get anywhere with that patch by chance?
Comment #5
miechiel commentedI fixed this for now by adding an extra check in the function subscribe_remap_files.
I changed the following in the subscribe.module (after patch run) On line 597 it says:
Chenged this to:
Looks okay on my environments.
Comment #6
ejohnson commentedHi Miechiel, thanks for the response and shedding some light on where the problem is.
I notice with your fix above, if there's no File Attachment attached to the node on the Publishing site, it never gets sent to the Subscribing site. It only gets sent to the Subscribing site if there is an attachment. So I removed the following code above:
and wrapped that IF Statement around most of the function. So the complete function in the subscribe.module looks like:
Hopefully this helps someone in the future.