Inline images not marked "permanent" after saving

Created on 28 March 2016, over 8 years ago
Updated 19 October 2023, about 1 year ago

When uploading inline images for use in a CKEditor text field, using Drupal's image upload dialogue as provided by the "Image" button in the editor_ckeditor module, the file is initially marked as "temporary" (file_managed.status = 0 in the database).

That is alright, as the idea is that it should be marked as permanent after saving the entity to which the CKEditor field belongs. In the Drupal 8 editor project in issue #1932652: Add image uploading to WYSIWYGs through editor.module they say on this topic and their solution:

Uploads through the WYSIWYG are only going to be stored as temporary files. [Originally] the module […] [would] need to implement a saving mechanism to mark the files as permanent. But now we implement this saving mechanism through entity hooks, so there is (fortunately!) no need anymore for a custom callback that every module has to call. [ source ]

However, in this Drupal 7 implementation, something is missing, as the files are still marked "temporary" after the entity is saved successfully. This happens everywhere I looked (nodes, custom blocks, …).

Temporary files will be deleted after DRUPAL_MAXIMUM_TEMP_FILE_AGE (usually 6 hours) during the garbage collection cron task. So this issue can lead to data loss.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇪Germany tanius

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