Problem/Motivation

I have added a Media reference in a content type and set it as optional. When creating new content, the Media field name is required and cannot save without setting it.

Steps to reproduce

  • Create a new media type 'my_media'
  • Add a field in your 'my_content_type' content type referencing 'my_media' type
  • Set the field as optional
  • Add content of type ''my_content_type'
  • Set the content type title and leave all the 'my_media' fields unset
  • Save

Proposed resolution

When adding a reference to Media as optional, 'Name' should be optional unless there is any other field fulfilled. So, the media is not created unless some field is informed.

Comments

dtamajon created an issue. See original summary.

dtamajon’s picture

Issue summary: View changes
cilefen’s picture

Version: 9.4.x-dev » 10.1.x-dev

This is marked as a feature request so I am moving it to the feature request branch. It has steps to reproduce which suggests it’s a bug report.

larowlan’s picture

What widget are you using for the media item?

dtamajon’s picture

I'm using a "Media" field with "Inline entity form - Simple" widget.

I cannot use "Media library" widget because I have some additional fields in the media type that are not shown to be fulfilled when using Media library.

larowlan’s picture

Project: Drupal core » Inline Entity Form
Version: 10.1.x-dev » 8.x-1.x-dev
Component: media system » Code

That module isn't part of core

dtamajon’s picture

You are right... I didn't see it before, sorry.

I have searched in Inline Entity Form module and there is already exactly this issue in process: #3099844

dtamajon’s picture

Status: Active » Closed (works as designed)
dtamajon’s picture

Status: Closed (works as designed) » Closed (duplicate)