Deprecate the Views relationship from moderated content to the "content_moderation_state" entity

Created on 13 July 2017, over 7 years ago
Updated 12 September 2023, about 1 year ago

Problem/Motivation

A relationship to the content_moderation_state entity was previously the only way to display and filter the moderation state for moderated entities. Now, views support has been built into the computed moderation_state field directly.

Reasons that deprecating this feature is a good idea:

  • The field should be the only way that developers and site builders need to reason about the storage of the moderation state, the entity in the background is marked @internal and there is even discussions about removing it entirely.
  • There are numerous bugs with the relationship: it creates weird text based exposed filters, it doesn't work with multiple languages, it doesn't add config dependencies etc.
  • Supporting it twice (via the field and via the relationship) includes a significant amount of additional code @see patch #6 and takes up resources in the issue queue.

Proposed resolution

Since relationships are more a feature of the Drupal "product" than an API, that is, it would be perfectly reasonable for someone to install Drupal, configure the relationship on a view without writing any code it has to be treated differently to most API deprecations. To solve this, there are two warnings in the UI which will tell users they are either about to use a deprecated feature or have already used it:

The change record will have detailed steps required to configure the supported field based views integration and steps on how to remove the relationship.

For folks who have done something heavily customised or extended the internal entity type in some way, a link to a contributed project will be provided which adds the relationships back.

The net result: less code to support and less confused users in the queue who don't understand why this relationship is so broken.

Remaining tasks

Agree on the approach and commit.

User interface changes

Additional UI elements pictured above.

API changes

None.

Data model changes

None.

📌 Task
Status

Fixed

Version

8.9 ⚰️

Component
Content moderation 

Last updated 1 day ago

Created by

🇦🇺Australia Sam152

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