- Issue created by @codebymikey
- Merge request !18Issue #3521185: Add error handling/logging for missing files → (Open) created by codebymikey
When the hash is being generated for a file that doesn't exist. It triggers a PHP warning along the lines of:
[warning] hash_file(public://deleted-file.pdf): Failed to open stream: "Drupal\Core\StreamWrapper\PublicStream::stream_open" call failed File.php:43
There should be a cleaner/dedicated logger for this scenario so that it can be better managed e.g. with monolog or filter for it within the watchdog logs.
Delete the real file on disk, and attempt to regenerate the hash for the Media entity.
Check if the file exists before attempting to generate a hash for it.
Provide issue fork/patch.
N/A
Active
2.0
Code