1

I have a view which displays fields from a content type but it also has a relationship to any entities which have a reference field to a node of this content type.

I have things like a title and body text plus some custom text fields on the view, the title and body are from the node.

However these do not display unless the referenced fields are not empty.

How can I get the view to display these fields still when the entity fields are empty?

2 Answers 2

1

You can achieve your requirement by unchecking Require this relationship option on relationship field.

enter image description here

2
  • Thanks this is what I suspected but these are already unchecked, strange behavour right?
    – user43161
    Commented Oct 4, 2016 at 8:10
  • Could you please attach view screenshot to question? Commented Oct 4, 2016 at 8:13
0

I recently had the same issue in Drupal 9 and had a terrible time figuring it out. My view is of one content type and has several relationships, including two to content in two entity reference fields on the content type. If either of those fields was empty for a particular node, it didn't display in the view. If I removed those relationships, everything showed up, but I needed them to display some data.

In my case I solved it by checking the "Disable SQL rewriting" option (in the "Advanced" tab > Query Settings). You want to be extremely careful with this as it will disable any node access checks and may show content to users who aren't supposed to see it, so you'll have to make sure to add access controls somewhere else in the view if necessary. In my case it's done through validation on a contextual filter, or it could be the view access settings.

This seems like a Drupal bug but I couldn't find any reports of it on drupal.org.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.