Closed (duplicate)
Project:
Views (for Drupal 7)
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Oct 2010 at 15:34 UTC
Updated:
1 Oct 2012 at 22:05 UTC
Jump to comment: Most recent file
Comments
Comment #1
dagmarYes this is a problem with the current implementation of views.
The solution could be include a relationship to the same node table to allow something like (node1.content_type=Y AND node1.Y_cck_field = Z) OR (node2.content_type=X) but I'm afraid this is not current possible with existent relationships provided by views.
Lets ask to merlinofchaos.
Comment #2
merlinofchaos commentedThat's odd. CCK fields are usually left joined.
Comment #3
dagmar@HnLn: Please export your view.
Comment #4
esmerel commentedComment #5
mallezieSorry to reopen this issue, but i found exactly the same issuu with views 6.x.3.x.dev
I have a filter:
Group 1:
node type in (A,B,C,D)
AND
Group2
( node_type_A_field = value OR
node_type_B_field = value OR
node_type_C_field = value OR
node_type_D_field = value )
Does an inner join which excludes results when only node_type_A has that field, and so on.
If you wan't more info....
Comment #6
dawehner... see http://drupal.org/node/935984#comment-3652918
In general it would be nice to have a way to reproduce the issue without having the need to click around for 15minutes.
Comment #7
mallezieIt's the view with name 'doen'.
It returns this SQL
I changed the SQL through a views hoof to replace the inner joins with left joins, which gives the correct output.
Comment #8
esmerel commentedComment #9
Mark Theunissen commentedI'm also seeing this issue. My view has:
(
Content type = 'Announcement'
)
OR
(
Content type = 'File'
AND
Has taxonomy term = 'Term'
)
I only get back the nodes of type 'File' with term 'Term'.
Further debugging shows that the problem is the INNER JOIN, changing this to a left join fixes it.
Comment #10
dmenefee commentedSeeing the same problem. I've attached the exported view and the SQL query resulting from it.
Comment #11
StG commentedSubscribing. I have exactly the same issue with this part of SQL:
INNER JOIN users node_node__users ON node_node.uid = node_node__users.uidComment #12
StG commentedI've investigated this issue a little bit, and I think I found the reason.
In my view I use content types: research_paper and review. The connection between them is based on a user reference cck-field (it's the reviewer). The view results in a list of papers assigned to a reviewer. Two filters are needed here:
These two filters works very well separately, but together not. The first filter creates this part of SQL:
INNER JOIN users node_node__users ON node_node.uid = node_node__users.uid(every node has its author) and this clause remains the same in the query when I use both filters. Thats why it returns only partial result.I guess a custom filter handler is needed here, but I don't really know how to begin...
Comment #13
johnpitcairn commentedI have similar behavior in 7.x-3.5, but in 7.x-3.3+173-dev the SQL query was indeed using LEFT JOIN for the optional filter field. See #1766338: Incorrect filter group OR behavior, LEFT JOIN changed to INNER JOIN.
Comment #14
geek-merlinso marking as dup of #1766338: Incorrect filter group OR behavior, LEFT JOIN changed to INNER JOIN
Comment #15
johnpitcairn commentedNot so sure it's a dup. All of these issues pre-date the commit that broke things in #1766338: Incorrect filter group OR behavior, LEFT JOIN changed to INNER JOIN