diff --git a/core/modules/content_moderation/config/optional/views.view.moderated_content.yml b/core/modules/content_moderation/config/optional/views.view.moderated_content.yml index d30a704..c4191b3 100644 --- a/core/modules/content_moderation/config/optional/views.view.moderated_content.yml +++ b/core/modules/content_moderation/config/optional/views.view.moderated_content.yml @@ -456,7 +456,7 @@ display: relationship: none group_type: group admin_label: '' - label: 'Operations links' + label: Operations exclude: false alter: alter_text: false @@ -627,7 +627,9 @@ display: group_type: group admin_label: '' operator: in - value: { } + value: + draft: draft + archived: archived group: 1 exposed: true expose: @@ -644,7 +646,7 @@ display: authenticated: authenticated anonymous: '0' administrator: '0' - reduce: false + reduce: true is_grouped: false group_info: label: '' @@ -707,8 +709,9 @@ display: relationship: none group_type: group admin_label: '' - operator: 'not empty' - value: { } + operator: 'not in' + value: + published: published group: 1 exposed: false expose: @@ -752,30 +755,30 @@ display: admin_label: '' empty: true tokenize: false - content: 'No moderated content available.' + content: 'No moderated content available. Only pending versions of the content, such as drafts, are listed here.' plugin_id: text_custom relationships: - uid: - id: uid + nid: + id: nid table: node_field_revision - field: uid + field: nid relationship: none group_type: group - admin_label: User + admin_label: 'Get the actual content from a content revision.' required: false entity_type: node - entity_field: uid + entity_field: nid plugin_id: standard - nid: - id: nid + uid: + id: uid table: node_field_revision - field: nid + field: uid relationship: none group_type: group - admin_label: 'Get the actual content from a content revision.' + admin_label: User required: false entity_type: node - entity_field: nid + entity_field: uid plugin_id: standard arguments: { } display_extenders: { } diff --git a/core/modules/content_moderation/src/ModeratedNodeListBuilder.php b/core/modules/content_moderation/src/ModeratedNodeListBuilder.php index 09a5b44..451fe5a 100644 --- a/core/modules/content_moderation/src/ModeratedNodeListBuilder.php +++ b/core/modules/content_moderation/src/ModeratedNodeListBuilder.php @@ -8,6 +8,7 @@ use Drupal\Core\Entity\EntityTypeBundleInfoInterface; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Routing\RedirectDestinationInterface; +use Drupal\node\NodeInterface; use Drupal\node\NodeListBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -93,6 +94,9 @@ protected function getEntityIds() { $query->pager($this->limit); } + // Exclude published content from the list. + $query->condition($this->entityType->getKey('published'), NodeInterface::NOT_PUBLISHED); + // Filter the list to only show nodes of bundles that can be moderated. $bundles = $this->bundleInfo->getBundleInfo($this->entityTypeId); $moderated_bundles = array_filter(array_keys($bundles), function ($bundle) {