Uploaded files are not permanent

Created on 29 May 2019, over 5 years ago
Updated 31 January 2024, 10 months ago

When a file is uploaded through the WYSIWYG using this plugin, it is stored as a "Temporary" file, not "Permanent". So it will be deleted by Drupal when cleaning the temporary file on cron run.

We can clearly see the "Temporary" state of the uploaded files in the "Files" tab of the Content section of the administration.

Proposed solution

The most convenient solution would be to add a file usage for the uploaded file, so it could be linked to the content, and therefore be cleaned up automatically if the content is deleted. A file with a file usage is always marked as permanent (@see src/FileUsage/FileUsageBase.php).

But if it's difficult to link a file to an entity through the WYSIWYG interface, at least use $file->setPermanent() in the upload form submit.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France mattew

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024