Support Media Library upload add form

Created on 19 May 2025, about 2 months ago

Problem/Motivation

Required on Publish marker it's not displayed when using the file upload form displayed by the Media Library core module Modal.

Steps to reproduce

  1. Navigate to Media Types (admin/structure/media) and create or modify and existing Media Type. Ex. Image
  2. On the Manage Fields tab, Add a new field and activate the "Require on Publish" feature and save the new field.
  3. Activate Media Library core module.
  4. Create or Modify an existing text format, Ex. Basic HTML (admin/config/content/formats), use CKEditor as a Text editor. On the Toolbar configuration, add Media library toolbar item to the active toolbar.
  5. Enable "Embed media" filter on this Text Format.
  6. Use this Text Format on a text field on a Content Type, Ex. Basic Page.
  7. Navigate to add a new node of this Content Type, on the field text field using the text format we created, click on the Insert Media button.
  8. On the Modal displayed, Add a File while choosing a valid file type.
  9. Once the file has uploaded the "upload add form".
  10. The Require on Publish marker would be missing.

Proposed resolution

Use form_media_library_add_form_upload_alter hook to allow fields to display Required on Publish marker

πŸ› Bug report
Status

Active

Version

1.10

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States paulsilva

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

Merge Requests

Comments & Activities

  • Issue created by @paulsilva
  • Pipeline finished with Failed
    about 2 months ago
    Total: 146s
    #501124
  • Pipeline finished with Failed
    about 2 months ago
    Total: 181s
    #501131
  • First commit to issue fork.
  • Pipeline finished with Failed
    about 2 months ago
    Total: 168s
    #501845
  • Pipeline finished with Failed
    about 2 months ago
    Total: 145s
    #501861
  • Pipeline finished with Failed
    about 2 months ago
    Total: 138s
    #501880
  • Pipeline finished with Failed
    about 2 months ago
    Total: 149s
    #501887
  • Pipeline finished with Failed
    about 2 months ago
    Total: 145s
    #501932
  • πŸ‡ΊπŸ‡ΈUnited States hungdo

    A boolean field is marked as Required On Publish showing 3 options: YES, NO, ANY, those values are rendered by default Drupal, however it is confusing because if it is marked required then it should have YES or NO options only, I pushed a change to the MR to remove the ANY option on both of regular add/edit form and media library upload form.

  • πŸ‡ΊπŸ‡ΈUnited States hungdo
Production build 0.71.5 2024