Svg Image Constraint Validator is not used in Media Library modal upload form

Created on 24 January 2025, about 1 month ago

Problem/Motivation

We've added a new FileIsSvgImageConstraintValidator in 🐛 Error uploading svg from the media tab Active to replace the old #file_validator approach. It works fine for the SVG Image field and the Media upload form at /media/add/vector_image, but it doesn’t get applied in the Media Library’s modal upload form.

Steps to reproduce

  • Install the SVG Image Field and submodule for Media integration.
  • Enable Media Library core module.
  • Ensure uploading an invalid SVG to /media/add/vector_image.
  • Add a Media field to Article content type, allowing Vector Image bundle for upload.
  • Select the Media Library formatter for the field's Form Display configuration.
  • Try to upload the same invalid SVG via the Media Library modal on /node/add/article.

Proposed resolution

Ensure the Media Library form uses the File upload Constraint Validator class.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.3

Component

Code

Created by

🇪🇨Ecuador jwilson3

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

Comments & Activities

Production build 0.71.5 2024