The delete and update hooks are applied to non-pdf files

Created on 22 April 2024, 7 months ago
Updated 11 June 2024, 5 months ago

Problem/Motivation

When updating or deleting file entities, this module implements hook_file_delete and hook_file_update and tries to do filesystem actions on the file being deleted or updated which fails since the preview does not exists in this case. A watchdog log is added every time this occurs. These hooks should only process the file if that file is an actual PDF.

Steps to reproduce

Create some none PDF file-entities. Modify or delete them. Check watchdog.

Proposed resolution

Add a mime-type check in the file_delete and file_update hooks.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇧🇪Belgium kriboogh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024