- Merge request !13Issue #3275875 made sure file extensions from image fields are not removed by hardcoded default values → (Open) created by Unnamed author
- 🇮🇳India sumit_saini
sumit saini → made their first commit to this issue’s fork.
I noticed that you can't change the allowed file extensions for image file entities. I tried changing the extensions List on all possible places you can define the allowed extensions. I checked here:
Everywhere I could think of where allowed file extensions can be set, are set. When I then upload a .webp image, it told me that the only allowed extensions are "png, gif, jpg, jpeg". I tried it with a field that doesn't use entity browser, it worked and took the allowed extensions from the field settings.
These are the steps to reproduce the bug.
As I read the code to figure out where this file extension check is done I came to this file entity_browser/src/Plugin/Field/FieldWidget/FileBrowserWidget.php:506
. There is a check which removes file extensions which aren't the default ones. I changed this line with this:
$extensions = array_unique(array_merge(explode(' ', $extensions), $supported_extensions));
If the array_insersect()
is necessary, I can do a workaround with not using the image filed type and use the file entity type.
Let me know what you think about this.
-
There is no UI changes necessary to fix this.
Also there is no API changes necessary.
Also no data model changes are necessary.
Needs review
2.0
Field widget
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
sumit saini → made their first commit to this issue’s fork.