This issue is for D7 only and it is a similar issue as this one for D6 : Support for inline content (e.g. images)
So I tested the patch for D7 suggested in that other issue for the feeds module in comment #9 along with version 7.x.29 of Mailhandler and the images are still published with the path : public://mailhandler_temp/imagename.png
As suggested by the Feeds module maintainer, I used the module Feeds Tamper to do a simple Find & Replace on the mail feed importer. You search for public:// and replace it with whatever is your full path to your image and that does the trick!
Maybe this could be fixed another way in the mailhandler module or elsewhere but this workaround is a good enough solution for my current needs. I thought it would be a good idea to share...
And thank you very much for a great module, Mailhandler does magic! :-)
Comment | File | Size | Author |
---|---|---|---|
#2 | inline-images-d7-2228401-2.patch | 2.06 KB | LeDucDuBleuet |
Comments
Comment #1
LeDucDuBleuet CreditAttribution: LeDucDuBleuet commentedHa Ha! I just realised my workaround only fixes the problem temporarily since files in /mailhandler_temp/ are managed by Drupal and deleted automatically after DRUPAL_MAXIMUM_TEMP_FILE_AGE elapses as stated in Attachment temp files, are they to be temporary?. So after a while, we end up with broken images in nodes created by mailhandler. There really is a bug somewhere because it does not make sense that these images stay in that temp folder...
Also, I wonder where and when these files should be moved to a permanent location? Should it be the Feeds module's job to look into the node html body in order to detect the "public://" files and move them somewhere else? Is so, where? I have looked in the code and the feeds node processor does not seem to touch at all the content of the node body. That is why I think maybe it should be done in Mailhandler -> MailhandlerCommands -> process function. I am working on a little patch to illustrate better what I mean...
Comment #2
LeDucDuBleuet CreditAttribution: LeDucDuBleuet commentedHere is my take on a patch for this bug, it may not be perfect and it could have been coded in many other ways...
It simply saves inline images in the arbitrary folder "/mailhandler/" and does not set them to be deleted automatically. It also replaces "public:/" with the actual path for the file in the body_html.
I've tested this solution on the current 7.29 and DEV with success, your mileage may vary.
Thank you.
Comment #4
LeDucDuBleuet CreditAttribution: LeDucDuBleuet commentedComment #5
LeDucDuBleuet CreditAttribution: LeDucDuBleuet commented2: inline-images-d7-2228401-2.patch queued for re-testing.
Comment #6
shevgenyNotifies an error in line 33 by using private file system, which is logical, because you just point to a public file system, but it is not entirely correct.
Comment #7
shevgenyIt does not work. Some error in line