Views of type 'Content Revisions' cannot be filtered out by content type

Created on 25 January 2017, about 8 years ago
Updated 27 May 2022, almost 3 years ago

Problem/Motivation

When creating a view of type 'Content Revisions', you should be able to directly add 'content type' as a filter criteria. There's no point in necessarily returning all content type revisions.

Proposed resolution

Ensure views of type 'Content Revisions' are able to be filtered out by the content type they're associated to, by default.

Work-around: add a relationship Content. (There are two relationships with the same label. One joins on vid, the other on nid.) Then filter on the type of that content.

Remaining tasks

Explore options. Do it.

User interface changes

Users are now able to filter out views of type 'Content Revisions' by content type directly.

API changes

TBD

Data model changes

TBD

πŸ› Bug report
Status

Closed: outdated

Version

9.5

Component
ViewsΒ  β†’

Last updated 12 minutes ago

Created by

πŸ‡«πŸ‡·France anavarre πŸ‡ͺπŸ‡Ί

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • I don't know why, but it also happens to me. Would be nice to find out a solution.

    Thank you

  • Status changed to Active over 1 year ago
  • πŸ‡¨πŸ‡¦Canada pavlosdan

    Re-opening as the issue is not solved even with the workaround in place.

    Steps to reproduce:
    - Install a site using the Standard profile
    - Enable Content Moderation and Content Translation modules (content moderation will give us the moderated content admin dashboard which has this issue "/admin/content/moderated")
    - Assign the "Editorial" workflow that gets created when enabling the content moderation module to the Article content type.
    - Add a second language to the site, e.g French.
    - Enable translation on the Article content type.
    - Add an Article node and mark it as published.
    - Add a translation for the article node that was just added but mark it as draft.
    - Visit "/admin/content/moderated" and observe that the Content Type column for our translated node will have no information in it.

  • πŸ‡§πŸ‡·Brazil carolpettirossi Campinas - SP

    I'm facing this issue. I installed moderation_dashboard module that comes with some views installed. I tried updating one of the views to list only "Blog" content type, however I cannot find the Type filter.

  • πŸ‡ΊπŸ‡¦Ukraine nginex

    I have exactly the same issue as described in #20.

    Turned out that when content moderation is enabled for a content type and there are multiple translations, the table node_field_data will list only published translations. This is a problem because nid relationship has extra condition to match the language

    For me the solution was quite obvious

    /**
     * Implements hook_views_data_alter().
     */
    function example_views_data_alter(array &$data): void {
      // We need to remove this extra language field in order to make it work
      // with unpublished translations of moderated content that are not listed in
      // node_field_data table.
      if (isset($data['node_field_revision']['nid']['relationship']['extra'])) {
        unset($data['node_field_revision']['nid']['relationship']['extra']);
      }
    }
    
  • πŸ‡ΊπŸ‡¦Ukraine nginex
  • πŸ‡ΊπŸ‡ΈUnited States vsawant

    I followed the same steps as listed in #20 and I can reproduce the error #Atlanta2025

Production build 0.71.5 2024