Ship with Document media entity per Drupal core

Created on 21 March 2022, over 2 years ago
Updated 1 March 2024, 9 months ago

Problem/Motivation

Drupal 8.8 changed file File to document Document, #3019202: Rename "File" media type to "Document" .

Sector ships with File entity, but core and contrib will increasingly expect Document media entities for PDF, docx etc. files.

Steps to reproduce

* Run up a Simplytest.me 9.x instance, enable Media module, observe /admin/structure/media lists media types Audio, Document, Image, Remote video, Video, not file.
* Run up a Sector 9.2.8 instance, observe /admin/structure/media lists media types File, Image, Remote Video
(sidequest: note capitalisation of "Remote Video" doesn't match Drupal core "Remote video.")

Proposed resolution

* Add Document media entity per Drupal core
* Mark File media entity as deprecated
* Consider helper script to transform File entities to Document entities

Data model changes

* Document uses field_media_document instead of field_media_file.
* Changes to media-related permissions.

🐛 Bug report
Status

Closed: outdated

Version

9.2

Component

Code

Created by

🇳🇿New Zealand jonathan_hunt

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

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.71.5 2024