I have two content types.

Photo
Album

For both content types, users can access only their own content.

Photo Content type has a node reference field to select *Album*. This field is not required and can have only 1 value.

In once view, we are displaying list of books with mention of Album name and some details of album. To fetch those details of Album, we are using Relationship and we did not check the checkbox *Require this relationship*.
1) Everything is fine in the View Preview photos with no album selected do not show up in the view.
2) As soon as I put on value in Photo to select one gallery, it appears in the view.
3) As soon as I removed Control Access module, it worked perfectly fine.

Any help is appreciated.

Thank you so much

Comments

alejandro_oses’s picture

Same problem, did you got to resolve this issue?

shenagarg’s picture

No. I could not get it resolved.

shenagarg’s picture

Is there any update on this? I can submit a patch however need some directions for it.

Thank you

cgdrupalkwk’s picture

Having the same problem.

purplezephyr’s picture

Priority: Normal » Major

This is more or less a showstopper for me. I posted to the Relation queue here:
https://drupal.org/node/2064445#comment-7755287

As I said there:

I have managed to trace the problem here:

SELECT
...
LEFT JOIN field_data_endpoints field_data_endpoints ON
node.nid = field_data_endpoints.endpoints_entity_id AND
(field_data_endpoints.bundle = 'provides' AND field_data_endpoints.endpo
ints_entity_type = 'node' AND field_data_endpoints.endpoints_r_index = '1')
LEFT JOIN field_data_endpoints field_data_endpoints2 ON
field_data_endpoints.entity_id = field_data_endpoints2.entity_id AND
(field_data_endpoints2.endpoints_entity_type = 'node' AND field_data_end
points2.endpoints_r_index != field_data_endpoints.endpoints_r_index AND 1 = '1'
)
LEFT JOIN node node_node ON
field_data_endpoints2.endpoints_entity_id = node_node.nid AND field_data
_endpoints2.endpoints_entity_type = 'node'
...
WHERE
...
( EXISTS (
SELECT na.nid AS nid
FROM node_access na
WHERE (
((na.gid = '0') AND (na.realm = 'all')) OR ((na.gid = '4
6') AND (na.realm = 'content_access_author')) OR ((na.gid = '2') AND (na.realm =
'content_access_rid')) OR
((na.gid = '4') AND (na.realm = 'content_access_rid'))
)
AND (na.grant_view >= '1') AND (node_node.nid = na.nid)
))

That EXISTS clause will fail if there are no permission rows for the other endpoint because the other endpoint is NULL. I have verified that replacing the EXISTS line with:
...
( node_node.nid IS NULL OR EXISTS (
...
produces the desired behavior (the row shows up, with blanks for the non-existent relations). What I haven't figured out is exactly where to even consider modifying the code to fix this.

Now that I know this module is the problem, I will continue digging here...

uniexpert786’s picture

is there any new update ? because same issue is here :(

purplezephyr’s picture

For the moment, I'm just moving to the Nodetype Access module.

rterman’s picture

Same problem. Incredibly frustrating.

vramiguez’s picture

I was having the same problem but found the following thread with the solution: https://drupal.org/node/1349080 . I applied #174 because I already have the latest version of D7, but if you have a previous version, perhaps #149 (but I haven't test it).

Hope it helps!

purplezephyr’s picture

I ended up having a similar problem with Nodetype Access, but I can't replicate it now, so I don't know for sure if the patch fixes it. However, that patch does fix the problem I was having with Content Access. Thanks!

bisonbleu’s picture

Issue summary: View changes

I ran into this issue in a slightly different way. A view I was using was filtering out (removing) relevant content as soon as I added a relationship. After loosing many hours thinking it was my views settings. I gave up and started hunting for a module to point my finger at. My issue disappeared when I disabled content_access. This is how I found this thread.

Followed @vramiguez's advice and ultimately applied patch in #195 to Drupal 7.32 and I'm happy to report that it works!

alauddin’s picture

Thanks @bisonbleu

I had similar issue when using author id as contextual filter to get related data from a entity referenced field

...for me the whole view was disappearing but the no results behaviour worked, as well as user1 was working.

Turning of content_access isolated the issue and applying the patch you mentioned
https://www.drupal.org/node/1349080#comment-8538295
to D7.34 worked for me.

cydharttha’s picture

https://www.drupal.org/node/1349080#comment-8538295 (#195) patch worked for us as well. Thanks!

jelhan’s picture

I applied newer https://www.drupal.org/node/1349080#comment-10953027 (#332) patch to Drupal 7 and got the issue fixed.

Should be noted in readme IMHO.

gisle’s picture

Version: 7.x-1.2-beta2 » 7.x-1.x-dev
Priority: Major » Normal

Looks like a core issue, but this behaviour and link to core patch mentioned in comment #14 should be in the help files.

  • gisle authored c801a6e on 7.x-1.x
    Issue #2020453 by gisle: Views do not require relationship does not work...
gisle’s picture

Status: Active » Fixed

This is in the help file in the latest snapshot 7.x-1.x-dev.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.