Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We have a 'Related content' view that pulls in nodes that have the any of the same taxonomy terms as a certain node. And it ends up generating this SQL which completely breaks Acquia servers: http://palantir.privatepaste.com/3f09eb28ac. Working on a testing view to replicate locally and export here to demonstrate.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1023456-many_to_one.patch | 3.95 KB | dawehner |
Comments
Comment #1
Dave ReidHere is the 'related content' view mimicking what we have in development.
http://palantir.privatepaste.com/1fdf587894
The meat is from the 'Taxonomy term ID' argument that uses PHP code for the default value:
There is also a Node ID argument so that the current node being used to compare its terms is excluded from the results.
Comment #2
dawehnerNot sure whether this is related to this issue, but this fixes at least one problem for me
#955464: Missing join: 'taxonomy_term_data' creating a Glossary view based on taxonomy
Comment #3
dawehnerHere is a similar query in d6
You can get rid of the joins by de-selecting "reduce duplicates". Not sure what for problems this might cause.
Comment #4
iamjon CreditAttribution: iamjon commentedChanging status. Based on comment #2
Comment #5
dawehnerCommited the fix.
Thanks #iamjon
But the initial issue itself can't be fixed. Ask earl for the reasons of the joins, but they have to be there to work as expected on all possible instances...
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedIt's an unfortunate consequence of many to one relationships. It's pretty difficult to compare a group that will generate multiple records to another group.
This looks like it is as fixed as it can be.