Media library support

Created on 15 November 2021, over 2 years ago
Updated 29 January 2024, 5 months ago

Problem/Motivation

The unique field validation works for EntityForm, even when you want to create a media entity, but. the media library uses the class FileUploadForm, that class has not a method getEntity, and we get an error from the media library using the unique field.

Error: Call to undefined method Drupal\media_library\Form\FileUploadForm::getEntity() in unique_content_field_validation_validate_unique() (line 231 of /app/web/modules/contrib/unique_content_field_validation/unique_content_field_validation.module)

Steps to reproduce

Install the module unique_field_ajax
Go to structure/media/fields create a new text field named "test"
Enable unique value on that field
Go to structure/ content types, add a new field named media to the basic content type
Go to structure/ content types / basic page, manage form display, the new field "media" should use the widget "Media Library"
Go to node/add/page, try to add a media using the media library and the unique field in the media library form.

✨ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡΄Colombia sergiogsanchez

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024