Existing media entity items don't respect update of allowed file extensions

Created on 9 February 2024, 11 months ago
Updated 15 February 2024, 10 months ago

Problem/Motivation

I have a pre-existing media type called "Hero banner image" has an image source. That source image field has the "Allowed file extensions" set to "png, gif, jpg, jpeg". It already has a number of items that are used throughout the site. I have now added "webp" to the list of allowed file extensions. If I create a new Hero banner image, it works fine with a *.webp image. However, if I edit one of the pre-existing items and remove the current image file (usually a *.jpg) and then replace it with a *.webp version, I get an error message: "Only files with the following extensions are allowed: png gif jpg jpeg."

Steps to reproduce

Create a media type with an "Image" Media source and save. Create a media item using your new media type and add a jpg image and save. You can now click "Manage fields" again for that media type and add "webp" to the list of Allowed file extensions" and save. Now go back and edit your media item and try to remove the jpg image and add a webp.

πŸ› Bug report
Status

Active

Version

10.1 ✨

Component
EntityΒ  β†’

Last updated about 4 hours ago

Created by

πŸ‡¦πŸ‡ΊAustralia jaydee1818 Melbourne

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

Comments & Activities

  • Issue created by @jaydee1818
  • πŸ‡¦πŸ‡ΊAustralia jaydee1818 Melbourne
  • πŸ‡¦πŸ‡ΊAustralia jaydee1818 Melbourne
  • πŸ‡ΊπŸ‡¦Ukraine shoroshanska

    If we are talking specifically about "webp" files, then the problem is not reproduced in Drupal 10.2.0.
    First, when creating a media type with an "Image" Media source, the "webp" extension is present in the "Allowed file extensions" field:

    I tried these steps to reproduce the problem:
    - create new media type and remove the "webp" extension from the "Allowed file extensions" field when creating;
    - create new media item using this new media type and add a "gif" image;
    - edit new media type and add "webp" to the list of "Allowed file extensions";
    - edit the media item in question, remove the "gif" image and add a "webp". I did not have any errors.

Production build 0.71.5 2024