Views using Entityqueue do not return results when Workspaces is enabled

Created on 29 May 2025, 8 days ago

Problem/Motivation

When the Workspaces module is enabled, Views that use an Entityqueue relationship and filter fail to return any results, even when content exists in the queue. This appears to be a compatibility issue between Entityqueue and Workspaces.

This issue is present on a site running Drupal 10.4.7 with Workspaces enabled, and Entityqueue version 8.x-1.9.

Steps to reproduce

  1. Enable both the Entityqueue and Workspaces modules.
  2. Create a new entityqueue and add one or more nodes to that queue.
  3. Create a View that displays content of the type added to the queue.
    • At this point, the view correctly displays content.
  4. Add a Relationship: Content queue, and select the entityqueue created in step 2.
    • The view still correctly displays content.
  5. Add a Filter Criteria: Entityqueue: Content In Queue and set it to Yes.
    • After adding this filter, the view no longer displays any content, even though nodes are present in the queue.

Here is the query for a view which includes a queue as a filter criteria prior to Workspaces being enabled:

SELECT "entity_subqueue__items"."delta" AS "entity_subqueue__items_delta", "node_field_data"."nid" AS "nid", "items_node_field_data"."name" AS "items_node_field_data_name"
FROM
{node_field_data} "node_field_data"
LEFT JOIN {entity_subqueue__items} "entity_subqueue__items" ON node_field_data.nid = CAST(entity_subqueue__items.items_target_id AS UNSIGNED) AND entity_subqueue__items.bundle = 'large_feature_slider'
LEFT JOIN {entity_subqueue_field_data} "items_node_field_data" ON entity_subqueue__items.entity_id = items_node_field_data.name
WHERE ("node_field_data"."status" = '1') AND ("node_field_data"."type" IN ('feature_slide')) AND ((entity_subqueue__items.items_target_id IS NOT NULL))
ORDER BY "entity_subqueue__items_delta" ASC
LIMIT 3 OFFSET 0

...and here is the query for the same view after the Workspaces module has been enabled:

SELECT "entity_subqueue__items"."delta" AS "entity_subqueue__items_delta", "node_field_data"."nid" AS "nid", "items_node_field_data"."name" AS "items_node_field_data_name"
FROM
{node_field_data} "node_field_data"
LEFT JOIN {entity_subqueue__items} "entity_subqueue__items" ON node_field_data.nid = CAST(entity_subqueue__items.items_target_id AS UNSIGNED) AND entity_subqueue__items.bundle = 'large_feature_slider'
LEFT JOIN {entity_subqueue_field_data} "items_node_field_data" ON entity_subqueue__items.entity_id = items_node_field_data.name
WHERE (("node_field_data"."status" = '1') AND ("node_field_data"."type" IN ('feature_slide')) AND ((entity_subqueue__items.items_target_id IS NOT NULL))) AND (("entity_subqueue__items"."revision_id" IN (SELECT MAX(entity_subqueue_revision.revision_id) AS "revision_id"
FROM
{entity_subqueue_revision} "entity_subqueue_revision"
WHERE "revision_default" = '1')) OR ("entity_subqueue__items"."revision_id" IS NULL))
ORDER BY "entity_subqueue__items_delta" ASC
LIMIT 3 OFFSET 0

Proposed resolution

It appears that when Workspaces is enabled, Views that join against entity_subqueue__items are affected by additional revision-based conditions that interfere with expected results. Specifically, Views adds the following clause when Workspaces is enabled:

AND (("entity_subqueue__items"."revision_id" IN (SELECT MAX(entity_subqueue_revision.revision_id) AS "revision_id"
FROM
{entity_subqueue_revision} "entity_subqueue_revision"
WHERE "revision_default" = '1')) OR ("entity_subqueue__items"."revision_id" IS NULL)

This clause seems incompatible with how Entityqueue currently stores or relates its items in Views, especially when the “Content in queue” filter is used.

A possible resolution might involve updating the Views relationship plugin for entityqueue to properly account for revisions and workspace context, similar to how revision-aware entities (like nodes or paragraphs) handle it.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.9

Component

Code

Created by

🇺🇸United States butterwise

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

Comments & Activities

Production build 0.71.5 2024