Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.Noticed there was an issue with support for media items that utilize remote stream wrappers to generate the content. I took a deep dive and found a possible solution, but we need to have a discussion on whether it makes sense to have it be used under the viewElements method for the PDFPreviewFormatter.
Also noticed that there was some discussion about this problem on the Drupal 7 version of this module, maybe we can find a better solution by looking at that one.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 3087506-8.patch | 1.79 KB | rithesh bk |
| #3 | remote_url_support_3087506-3.patch | 1.43 KB | marioangulo |
Comments
Comment #2
marioangulo commentedComment #3
marioangulo commentedHere is a patch for this issue.
Comment #4
marioangulo commentedComment #5
marioangulo commentedComment #6
mstrelan commentedfile_get_contents(), see https://www.drupal.org/node/1862446file_unmanaged_save_data()is deprecated too, see https://www.drupal.org/node/3006851Comment #7
rithesh bk commentedcurrently i am working on it ............
Comment #8
rithesh bk commentedPlease find the updated patch ......
Comment #9
mstrelan commentedActually this code should be called from
PDFPreviewGenerator::createPDFPreview(). The existingfilemtime()checks inPDFPreviewGenerator::getPDFPreview()will be problematic. I guess we could do something like this:However that means we'll never generate an updated preview if the source PDF changes. Not sure how much we can do about that as I really don't want to download the PDF every time the preview is requested.
We also need to extend
PDFPreviewGeneratorTest::testGetDestinationUri()to handle remote stream wrappers.Comment #10
mstrelan commentedComment #11
mstrelan commented