Hi. So, I've got a view that has a relationship to what I think of as a "parent node".

One of my arguments uses this relationship. When I use it, the table gets joined in with a LEFT JOIN. Curiously, one of the join conditions ends up being field != value, where value was the value of the argument. It seems strange to me that, when trying to find things matching a certain value, we would make a join that brings in everything except what we want to find.

Could this simply be a bug? I found, in the function "ensure_my_table", where this join condition is added (into "extra"). When I changed the != to =, I got the results I expected. Could the bug be that simple? Perhaps there's something more subtle, such as that we got into that code path when we shouldn't have.

CommentFileSizeAuthor
views_arg_sense.diff627 bytesgalaxor

Comments

dawehner’s picture

Assigned: Unassigned » merlinofchaos
Status: Active » Needs review

Update status.

Can't think of reason for != but this should be reviewed by merlinofchaos.

In general i think noone ever used summaries together with multiple tables.

Status: Needs review » Needs work

The last submitted patch, views_arg_sense.diff, failed testing.

merlinofchaos’s picture

Status: Needs work » Closed (works as designed)

That condition is used for ORs where it's adding multiple joins and testing multiple conditions. When doing multiple joins against the same table, we add restrictions so that the additional joins won't just bring in the same data.

This is the intended behavior.

galaxor’s picture

Hm. I guess the problem, then, is somewhere else. It's probably sending me to this code path when it should not.

I suspect the views_or module, since that's the most unusual thing I'm using in my arguments.

merlinofchaos’s picture

Yes, the views_or module is going to choke on any field using that piece of logic, unfortunately.