Using Gutenberg Drupal 8.x-1.10 on Drupal 8.8.1, all files uploaded via the core/file block are listed as Temporary with 0 uses in Drupal’s file list. Consequently, they are automatically deleted after a while.
Uploading images with the core/image component, on the other hand, works fine. After saving, the image is marked as permanent.
Could this be a problem in our configuration? We’re not using a custom module here, just the default File component.
Here is a screenshot of the file list with the same file twice - once uploaded with core/image and once with core/file:

Comments
Comment #2
wmnnd commentedComment #3
bgm commentedHi, I have users who seem to be running into this bug from time to time. Their images disappear after some time. Although it does not seem to be systematic. Image attachments seem to work fine most of the time.
Is there something in user behaviour that could be causing it?
For example, I noticed that sometimes when users run into problems, they copy-paste the blog post into a new blog post, presumably without re-uploading the images. That would trigger a deletion, right?
Comment #4
szeidler commentedThanks for the report.
This seems to be related to the g-media-attributes library. I added a pull request there to add the entity attributes to the markup, which will make Drupal set the files permanent, once the content is saved.
Comment #5
codebymikey commentedThis should be addressed after the #3163200: Make Gutenberg entity-type-agnostic issue lands.
It already includes @szeidler's fixes https://git.drupalcode.org/project/gutenberg/-/blob/c28eeb29/js/media-at...
The
g-media-attributespackage was migrated into the module to make it immutable and it also makes it easier to address changes within D.O.One thing to bear in mind with this change is whether a
deprecatedproperty is needed to migrate existing content or not.Comment #6
codebymikey commentedComment #7
codebymikey commentedComment #8
thorandre commentedAssigning to Marco.
He'll address the bug and fix this on the g-media-attributes package. Seems like codebymikey is on to something, so let's look into that.
Comment #9
szeidler commentedComment #10
szeidler commentedThis problem seems to be mitigated by the media module. if you use Media in core, the uploaded file will be marked as being permanent, since it's related to the media entity.
Since not having media is rather an edge case, I'm lowering down the priority.
Comment #11
szeidler commentedSolving this seems to be a bit more challenging, although the priority is not that high anymore, knowing it will just not be a problem with enabled media in core.
The challenge is, that we would need to whitelist the HTML elements, to actually make the the required tags
data-entity-type="file" data-entity-uuid="254b5724-fc89-4852-8c81-1d5855a4fc2b"appear in the markup. With those tags the Drupal core editor module will take care of the file tracking and mark the file as permanent.It seems that changing the following line in https://github.com/front/g-media-attributes/blob/master/src/override.js#L47 would to the trick.
From:
to:
You will see that this is far from being elegant, but seems to be the only working approach without bigger refactoring.
@marcofernandes: Regardless of my comments above. I also noticed that the merged in tag on the github repositrory didn't automatically got published on npmjs.com, which makes it not possible to directly update it with the update script in Gutenberg. See https://www.npmjs.com/package/@frontkom/g-media-attributes
Comment #12
marcofernandes commentedI'm having issues publishing to NPM. I'll check this ASAP.
Comment #15
marcofernandes commented@szeidler changed g-media-attributes as you suggested. Tested and files now move to permanent. Thanks!