x3ro / redmine_amazon_s3

This Redmine plugin stores file attachments on Amazon S3 instead of the local filesystem.
https://x3ro.github.io/redmine_amazon_s3/
MIT License
8 stars 11 forks source link

No Images at PDF Export #11

Open TumTum opened 7 years ago

TumTum commented 7 years ago

Hi,

after install that Plugin, work all fine. But if I export a PDF that has no Images. Can you that fixed?

Kind regards Tobi

PS: I like your Docu, that was wrote good

thorsten-de commented 7 years ago

Investiating this issue, it seems that there's a more severe problem. In Redmine's codebase (V3.3). there are a bunch of usages of attachment.diskfile, and it is assumed to be a local file. If I run the redmine test suite, after enabling redmine_amazon_s3, I'll get some failures with the same pattern: assert File.exist?(diskfile). They certainly fail, because the diskfile doesn't exist locally.

This is also directly connected to pdf export: Redmine only exports images which are attachments in that wiki page oder issue, and it checks whether the attachment is readble. Attachment#readable is defined as File.readable?(diskfile), so it'll never be readable if the file is stored on S3.