Fix WSOD when media source file is missing #834
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GitHub Ticket: N/A
What does this Pull Request do?
Adds a check to the MediaHasMimetype condition plugin to ensure a source file is found before attempting to call
getMimeType()
on it. This will only occur in rare instances where a file is missing from the media due to a bad migration (which happened to me) or other system failure.What's new?
Adds the file variable returned from
$this->mediaSource->getSourceFile($medium)
(which returns false when no file is found) to the subsequentif
statement and before the getMimeType check.How should this be tested?
Interested parties
@Islandora/8-x-committers