- Issue created by @slayne40
- 🇫🇷France rubberg
Hi @slayne40 ,
Could you please add steps to reproduce the error you encountered?
I tried to review your patch but was not able to get the error.
Tested on Drupal 10.3.5 and Media PDF Thumbnail 6.1.1 (php 8.2.20)
Thank you.
- 🇮🇹Italy finex
Hi, I've had the same error followed by another (which is probably the cause):
attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/426
It's an error on the server imagemagick policy.
I suggest to catch the error and display a message to inform the user to update the imagemagick settings.
Hi,
I'm able to reproduce the error with the very specific following configuration:
- On a dev environment, I imported a dump of the prod database
- Since I'm not interested in getting all production uploaded media files, I did not get an archive of all of them. Just got the latest ones.
- I'm now running a dev environment with references to uploaded PDF files stored in the database but without the actual files stored in the upload directory.
When launching cron, I'm facing the typeError issue because of the missing files. The process fails in MediaPdfTumbnailImagickManager::generateImageFromPdf() which raises an exception due to the missing file, writes a log entry about it
and then returns NULL. Because of this NULL, the remaining part of the generation process runs into the typeError error.I agree with @slayne40, createThumbnailFileEntity should be allowed to accept NULL to prevent failure and WSOD.
Tested the #2 patch, it's working.