Jump to:
| Project: | Domain Access |
| Version: | 7.x-3.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (works as designed) |
Issue Summary
We ran into a situation I'm trying to resolve with entity references and Domain Access. Here is a brief summary; this is a bit complicated to describe so I hope this makes sense:
Node 1: A simple test node
Domain access: settings published to a.mysite.com, b.mysite.com, and c.mysite.com
Entity references on Node 1:
Node 2 (published only to a.mysite.com)
Node 3 (published only to b.mysite.com)
Node 4 (published only to c.mysite.com)
The user has full edit rights on all 3 domains, and full edit rights Nodes 2, 3, and 4 when visiting those pages individually. And, in theory, they also have full edit rights to Node 1 but as you can see below this access fails.
The problem:
When the user (on any domain) attempts to save an edit to Node 1 they get an error message from entity reference:
The referenced entity (node: 3) is invalid.
The referenced entity (node: 4) is invalid.
This assumes the user was saving the changes from a.mysite.com; had they been at b.mysite.com the error would be:
The referenced entity (node: 2) is invalid.
The referenced entity (node: 4) is invalid.
In other words, the error is triggered for any referenced node that does not belong to the domain the user is currently visiting.
For admin users with full content permissions, everything works as expected from any domain.
Do you have any insight here? I'm not positive whether I should be bugging you, or the folks over at entityreference but since this seems to be domain related I figured I better start here. Let me know if you need any clarification, and thanks.
Comments
#1
Well, this is a general Node Access problem that would also occur with entity references assigned, say, to an Organic Group.
I don't know that there is much that either module can do about this issue, based on how grants work. You likely need some custom validation code to make this work. Perhaps the ER folks can make that easier to implement.
#2
You must publish nodes of a particular type to any domain that needs to access nodes of that particular type.
So on the edit page of the Content Type that is being referenced make sure you set it to be published to all the domains that need to access it.
#3