I am unable to see results that are empty in a view when the content access module is enabled.
- I have two content types, Foo and Bar. Bar has an entity reference to Foo.
- I also have a role, that has "View Any" and "View Own" permissions of both Foo and Bar.
- Content access permissions have been rebuilt: /admin/reports/status/rebuild
- Cache cleared
- I also have a view that shows a list of nodes of type Foo, with a NOT required relationship to the content that references it (the nodes of type Bar).
As an admin:
Expected result
All of the rows appear as they should. The rows with empty results on the relationship still show.
Actual Result
Same as expected result
When I look at it as a user with the role that has "View any" and "View Own" permissions to the two content types:
Expected result
All of the rows appear as they should. The rows with empty results on the relationship still show.
Actual Result
The rows with empty results on the relationship do not show at all.
I have narrowed this down to the content access module, because uninstalling the module and rebuilding permissions shows the expected result in all cases. Also installing again and rebuilding permissions even with default settings, causes this to happen.
Comments
Comment #2
tlyngej commentedHi commonColby
Make sure that the user also has permissions to view the entities that your are using in your relationships.
Also, make sure that no sort of field permissions are blocking the user from seeing the content of the fields.
Comment #3
cslevy commentedThe problem comes from Core.
See this:
https://www.drupal.org/node/1349080
I had the same issue. I applied patch from the above issue fixes the problem.
Comment #4
gisleDuplicate of #2020453: Views do not require relationship does not work if the relationship is not there.
Comment #5
duneblLike #3, I confirm that this is a core bug solved by #1349080: node_access filters out accessible nodes when node is left joined