Problem/Motivation

In \Drupal\pdfpreview\PDFPreviewGenerator::createPDFPreview it is assumed that the source file exists, but there are cases where this isn't the case. That could either be corrupt data, lost files, or e.g. pipelines where not all files are made available.

Steps to reproduce

Proposed resolution

Check for the source file before calling imagemagick.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork pdfpreview-3610075

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jurgenhaas created an issue. See original summary.

jurgenhaas’s picture

Status: Active » Needs review
mstrelan’s picture

In 2.0.x (which is not ready for real world use) this is already handles and returns NULL. I guess we should match that?

jurgenhaas’s picture

Well, the doc block declares that this method return boolean, not null. Changing the return type would be a breaking change. Therefore, returning FALSE is probably better here?

mstrelan’s picture

Fair point, I think in 2.0.x it returns the actual file path on success instead of TRUE. I'll have to come back to work on 2.0.x some day.

  • mstrelan committed 79e02d70 on 8.x-1.x authored by jurgenhaas
    fix: #3610075 \Drupal\pdfpreview\PDFPreviewGenerator::createPDFPreview...
mstrelan’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.