I was in the need of being able to add the node's language to the relationship, so that I can relate to nodes of a specific language, but still get the query even if there's not a node on that language.

This is why I needed this in the relationship and I couldn't do it with filters:

... LEFT JOIN node n ON .... AND n.language = 'en'.

As opposed to:

... LEFT JOIN node n WHERE n.laguange = 'en'

Attached is a patch that sorts this, I would like feedback if this would ever be accepted or if I am better off doing this on an alterer module.

Comments

hanoii’s picture

Status: Active » Needs review
StatusFileSize
new3.55 KB

Worth noting that I did this on a new handler for one specific filter. I thought that maybe this can be added in the general views_relationship_handler and add this option depending on the relationship table's base, but maybe I am going to far so started with this.

chris matthews’s picture

Issue summary: View changes

The 6 year old patch applies cleanly to the latest views 7.x-3.x-dev, but still needs to be reviewed.

Checking patch modules/taxonomy.views.inc...
Hunk #1 succeeded at 291 (offset -1 lines).
Checking patch modules/taxonomy/views_handler_relationship_term_node.inc...
Checking patch views.info...
Hunk #1 succeeded at 181 (offset 12 lines).
Applied patch modules/taxonomy.views.inc cleanly.
Applied patch modules/taxonomy/views_handler_relationship_term_node.inc cleanly.
Applied patch views.info cleanly.