Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
My issue is similar to the one described at https://www.drupal.org/node/2712863
The only difference to the described problem is that I already have file_entity enabled and this problem occurs only with certain file types (like .zip).
Problem/Motivation
1. Install file_entity
2. Upload a .zip file using a field on some entity
3. Go to file administration /admin/content/files and edit the uploaded file
3. Replace the file or just click "Save"
Unexpected result:
PluginNotFoundException: The "entity:file:undefined" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition()
Comments
Comment #2
rutiolmaOk, actually this is just a matter of configuration.
There should be a file-type for "less common" MIME types at /admin/structure/file-types (not just Document, Image, Audio...)
IMO a "Generic" file type should be set by default, accepting all MIME types, with a lower relevance than any other types, otherwise the user will get these errors
Comment #3
gmangones CreditAttribution: gmangones commentedHi, worked fine, Thank's
Comment #4
tcrawford CreditAttribution: tcrawford commentedI was suddenly seeing this issue on Drupal 10.2 where we have file_entity still installed.
The missing mime-type was "application/octet-stream" when uploading a pdf via a managed file widget.
To debug, place a stop point in the function file_entity_file_type(FileInterface $file) to determine what the mime type is that is not resolving.
Add the missing mime type to an existing (or new) file type at /admin/structure/file-types
A more sustainable solution would be to migrate away from file_entity.