Closed (duplicate)
Project:
Domain
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Jan 2012 at 00:08 UTC
Updated:
11 Oct 2014 at 23:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jojonaloha commentedHere is the proposed patch.
Comment #2
agentrickardTwo issues:
1) The patch doesn't conform to coding standards.
2) How do you test this?
Comment #3
jojonaloha commented1) I think the attached patch fixes this, I've read http://drupal.org/coding-standards and still had a hard time finding issues
2) I can describe my use-case a little which may help.
I have domain, domain_alias, domain_conf, domain_content, domain_settings and domain_theme enabled.
I have a few content types: We can call them "Event" and "Moderator"
A moderator is not a user but has a picture and a bio.
An event may have 1 moderator, using a nodereference field. It is an optional field.
I have a view that displays all Events for the current domain with the Moderator's picture, linked to their bio. I need the view to display all events even if there is no moderator. In my view I have a relationship to the Moderator which is not required.
This worked as I expected before the update to Views 7.x-3.1, after the update the query changed so that node_access is joined for Moderator as well. By using an INNER JOIN between node_access and the moderator, it was forcing the relationship to be required.
Comment #4
agentrickardLooks good. I see the logic here. This is a problem caused only for administrators.
What is odd to me is that core doesn't seem to use this pattern. From _node_query_node_access_alter():
Do you have a View you can export and attach for testing?
Comment #5
jojonaloha commentedHere is my exported view, I stripped out some of the extra displays and client info.
Comment #6
agentrickardThis is going to have to wait for the dust to clear on #681760: Try to improve performance and eliminate duplicates caused by node_access table joins.
Comment #7
agentrickardComment #8
jojonaloha commentedNoticed there was a fix committed for that issue in Drupal 7, http://drupal.org/node/681760#comment-5701576
I've attached a patch based on the accepted patch from that issue. I'm not sure it solves this issue, but at least its a starting point based on what is (will be) in core.
Comment #9
agentrickardIs this still an issue?
Comment #10
agentrickardAn updated version of this patch is in #1855298: EntityFieldQuery and Domain Access
Comment #11
Leeteq commented(Cross-referencing since this issue has a very descriptive/clarifying title)