Problem/Motivation
The views relationship plugin doesn't work inside workspaces because it doesn't join the entity queue items revision data and has no condition/join for the current workspace.
Steps to reproduce
TBD.
Proposed resolution
Add an new relationship handler that joins queue items revision data and workspaces as necessary.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork entityqueue-3489180
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
amateescu commentedLooked at this for a long time, and I think it should be fixed with a combination of changes in core Workspaces and our custom relationship handler, but I couldn't get to an actual proposal yet, so let's go with what we have here if it works.
I'd like to see a few changes to the MR though: in order to allow this fix to be applied without having to do any manual config updates on existing sites, let's put all the new code in the existing relationship handler, inside additional methods that kick in only if the workspaces module is enabled and if there's an active workspace.
Comment #4
s_leu commentedThanks for the review, I addressed the feedback.
Comment #6
amateescu commentedStill hoping that this is a temporary solution.. merged into 8.x-1.x, thanks!
Comment #8
joao.ramos.costa commentedHi everyone,
still investigating but I think there's some issues when commit b124c65a introduced entityqueue_views_query_alter.
1 - This line
if (\in_array('entityqueue_relationship', $join_ids, TRUE)) {:It should look for relationship plugin 'id' and not for its key as we might have more than one relationship where _n is appended.
2 - The expression
$subquery->addExpression("MAX($revision_table.{$keys['revision']})", $keys['revision']);Doesn't seem to take into account when 'limit_queue' option from entity_queue ViewsRelationship is set, or more than an entity_queue, I guess.
3- entity_subqueue_revision table doesn't include the parent queue, in case of a subqueue set as 'limit_queue', so it makes dificult to add a condition clause here too.
Again, sorry to be introducing so many questions. Thanks for the work involved here, it's actually not an easy problem to deal with.