Make media compatible with content moderation

Created on 24 July 2018, almost 6 years ago
Updated 7 September 2023, 10 months ago

Problem/Motivation

I was reviewing the Media module recently and saw two bits of logic that definitely won't work with Content Moderation:

1. \Drupal\media\Plugin\QueueWorker\MetadataFetcher::processItem loads media items by ID, which will always load the default revision. If I understand this correctly, changing the source field on a forward revision (Draft) of a media item will not update the metadata for the latest revision.

2. \Drupal\media\MediaStorage::shouldUpdateMetadata compares the new source field value with $media->original. If $media->original isn't set the default revision of the media is loaded. Instead of loading the default revision, we should load the latest revision, I think. This one is a bit trickier and may not present practical bugs.

Proposed resolution

Add explicit support for forward revisions in the media module.

Remaining tasks

Audit more of the media module and determine what parts are incompatible with content moderation, then write a patch.

User interface changes

None.

API changes

Undecided.

Data model changes

None.

πŸ“Œ Task
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
MediaΒ  β†’

Last updated about 6 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States samuel.mortenson

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