I am trying to determine the cause to the behavior I am experiencing. I am using an exposed filter that is using multiple relationships.

Content Types:

Business Unit
Business Unit Products --> Entity Reference field to Business Unit
Product --> Entity Reference field to Business Unit & Entity Reference field to Product Category (could be multiple)
Product Category

The View is a Block that displays on pages of Content Type Business Unit Products. A Contextual Filter is placed on Nid setting the default value to the Content ID from URL. The following relationships are set on the View:
Entity Reference: Referenced Entity --> using the field pointing Business Unit Products to Business Unit --> Require Relationship
Entity Reference: Referencing Entity --> using the field pointing Product to Business Unit --> Require Relationship
Entity Reference: Referenced Entity --> using the field pointing Product to Product Categories

The main Display Block filters Content Types based on Product. The Title field is displayed using the relationship of the field pointing Product to Business Unit.

The Entity Reference Display is using the same contextual filter and relationships and filters Content Types based on Product Category. When entering the Nid for a Business Unit Products page all of the results return correctly in the preview for this Display.

An exposed filter is created on the Main Block for Product Categories using the relationship of the field pointing Product to Business Unit and using the Entity Reference Display that was just created.

When the page is rendered there is only one item displayed in the filter when there should be many. This shows that the relationships are all correctly working and the Entity Reference Display is working to some degree that it's displaying a result in the filter.

Does the module handle this scenario or is there some other configuration that is being overlooked?

Comments

rupyjl’s picture

I have a similar setup to the one described above, and I am seeing exactly this behaviour as well.

Only one value from the entity reference view is returned in the dependent dropdown (even though on the ER view itself all values are shown). The one value shown in the DD is always the last one in the ER view - so if I sort differently in the ER view, a different value is shown in the DD - so it is sensitive to the order of the ER view.

I have other implementations of this module which work perfectly - so this is puzzling. Any help would be appreciated.

taote’s picture

I've got this issue too. It seems that happens when the reference field is set in the parent with multiple children, for example an order with multiple items. If the field reference is set in the child pointing to the parent it works.

I need to do it like this because I want to use the module Inline Entity Form to create the children nodes. Does anyone know how to make it work with this type of scenario?

nonprofit’s picture

If you can instead use a contextual filter, there is https://www.drupal.org/project/views_contextual_filters_or.