My situation:
Commerce kick start installed
Domain Access installed
Views and Domain Views installed
I have one primary domain and 2 other domains.
I created 2 articles to which the 3 domains have access (publish to all affiliates turned OFF, they are individually assigned to each domain)
I created a very basic simple view which displays for example all articles, no filters, no relations, nothing but displaying the article titles.
My problem is also very simple: the articles (or whatever other node you would pick) are not displayed except on the primary domain. Though they are published to every domain and no other filters are set, not even domain filters.
When observing the query generated on the primary domain and the query of the exact same View on another domain we see a difference, which is odd because no domain specific filters or other settings are set.
Query on the primary domain (this one works because of the extra OR( (na.gid = '0') AND (na.realm = 'domain_id') ):
SELECT DISTINCT node.title AS node_title, node.nid AS nid
FROM
{node} node
INNER JOIN {node_access} na ON na.nid = node.nid
WHERE (( (node.status = '1') AND (node.type IN ('article')) ))AND(( (na.gid = '0') AND (na.realm = 'all') )OR( (na.gid = '0') AND (na.realm = 'domain_site') )OR( (na.gid = '0') AND (na.realm = 'domain_id') ))AND (na.grant_view >= '1')
LIMIT 10 OFFSET 0Query on another domain (not working):
SELECT DISTINCT node.title AS node_title, node.nid AS nid
FROM
{node} node
INNER JOIN {node_access} na ON na.nid = node.nid
WHERE (( (node.status = '1') AND (node.type IN ('article')) ))AND(( (na.gid = '0') AND (na.realm = 'all') )OR( (na.gid = '0') AND (na.realm = 'domain_site') ))AND (na.grant_view >= '1')
LIMIT 10 OFFSET 0When I set 'publish to all domains' on both articles, they are displayed correctly in the view on all domains, but I don't want to set that option.
I hope it's just a wrong setting... Thx for any reply in advance
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | domain-views.png | 97.86 KB | fernly |
Comments
Comment #1
agentrickardThis is the standard behavior of Node Access. Those query conditions are always added, regardless of your View definition.
You can only use Domain Views to filter content under two conditions:
* The content is sent to all affiliates -- as you have noted.
* You use the advanced Views option to disable node access for the view.
Comment #2
fernly commentedHi Agentrickard,
Thx for your reply. First of all: the view works (but..)
I applied the first condition, the second I didn't find but wasn't necessary to make the view work.
I checked the 'send to all affiliates' on all articles and now the view works (I can check and uncheck each domain for each article and this is displayed correctly in the view). I was just wondering what the reason is the content has to be sent to all affiliates. It doesn't make sense to me. Also because this option claims to override any individual affiliate publishment, which it does. So the content is still viewable to the logged in user (because of the 'sent to all affiliates' option). Now the view works fine, but the content which isn't displayed in the view is still accessible by the user.
I think I'm missing the last piece of the puzzle, or it has something to do with the second condition you were talking about (which I didn't find in the advanced view options). Thanks a lot for your information.
Comment #3
fernly commentedComment #4
agentrickardRead the module documentation. Items not sent to all affiliates are already filtered based on the current domain. This is the original design of the module. I think the confusion is caused when trying to add views filters. DA already filters content. You run into trouble if you want content published to domain A to be visible on domain B (but not on C or D).
Views does have an advanced option to disable node access controls. I am away from a computer, but you'll find it if you look (or Google).
Comment #5
fernly commentedThanks for standing me by, Agentrickard.
The first thing I did was reading the documentation, but somehow I can't get it right. In D6 I set up the exact same structure without problems. Now I'm building it in D7 and it just won't do it.
I just want to create a view that displays the nodes to which the current domain has access to, without using the option 'send to all affiliates'.
So according to your information I need to disable the node access control in the view (which I can't seem to find), even after asking my friend Google. In D6 this worked out of the box, isn't this the case anymore for D7?
I added a screenshot of my views setting page (it's very basic, just displaying article nodes with the domain access filter 'current domain'), I really can't find this node access disable option, my apologies.
I'm missing something (stupid), I can feel it.
Thanks a lot in advance, I appreciate it.
Comment #6
fernly commentedI have been searching for this node access disable option in views (and other possible solutions) for a few days now. Dead end. I haven't even found any evidence of the existence of this option whatsoever (my apologies to Agentrickard; I hope you can show it to me once, now I'm so curious where it could be!).
Can someone give any tips to set up this domain view without setting the 'send to all affiliates' option?
I'll repeat my intention to anyone new to this thread:
To create a view which displays all the nodes that are published to the current domain (without sending content 'to all affiliates')
I'm losing my mind because this sounds like the easiest view ever, but it won't work!!
Comment #7
fernly commentedApparently it has nothing to do with Domain Views, so I changed the project.
I disabled the Domain Views module because I first want to make the view display all article nodes on every domain. Why isn't this default behavior?
Only the primary domain displays the nodes. On every other domain the view gives no results.
How can I make this work? Anyone?
Comment #8
fernly commentedI got it. I finally got it.
I kept on looking for disabling node access in the view and guess what.. I found it (unfortunately not on the internet).
If anyone ever runs into this issue: In your view you go to Advanced (thank you Agentrickard for that tip), then you go to Query Settings and you disable SQL Rewriting (which of course also disables node access).
So... all nodes are displayed in the view on every domain and now you can unleash Domain Views and let it do its thing.
I wouldn't have come up with this solution by myself so I think it's rather strange no one else has run into this.. but that's for the best I guess!
@ Agentrickard: Perhaps it's interesting to put these 2 conditions you told me about somewhere in the documentation of Domain Views? If it isn't already in there of course... I didn't find it :)
Thanks again!