diff --git a/core/modules/content_moderation/src/Plugin/views/filter/ModerationStateFilter.php b/core/modules/content_moderation/src/Plugin/views/filter/ModerationStateFilter.php index 091210d86a..3678efcf87 100644 --- a/core/modules/content_moderation/src/Plugin/views/filter/ModerationStateFilter.php +++ b/core/modules/content_moderation/src/Plugin/views/filter/ModerationStateFilter.php @@ -74,6 +74,8 @@ public function getValueOptions() { */ public function ensureMyTable() { if (!isset($this->tableAlias)) { + $node_table_alias = $this->query->ensureTable($this->table, $this->relationship); + // Filter the moderation states of the content via the // ContentModerationState field revision table, joining either the entity // field data or revision table. This allows filtering states against either @@ -84,7 +86,7 @@ public function ensureMyTable() { $configuration = [ 'table' => $entity_type->getRevisionDataTable(), 'field' => 'content_entity_revision_id', - 'left_table' => $this->tableAlias, + 'left_table' => $node_table_alias, 'left_field' => $left_entity_type->getKey('revision'), 'extra' => [ [ @@ -110,7 +112,11 @@ public function ensureMyTable() { * {@inheritdoc} */ public function calculateDependencies() { - // @todo calculate dependencies in https://www.drupal.org/node/2901690. + // Do not depend on the workflows which provide states that are utilised + // in the filter. States cannot be depended on directly and can also be + // common across multiple workflows. States and workflows with existing + // content cannot be deleted, so the impact of not depending on them here is + // mitigated. return parent::calculateDependencies(); }