Entity Reference is great. Thanks for this module.

I'm trying to filter the values available in an Entity References "Entity Selection" list on a node edit form to only show nodes relevant to the current node being edited.

I am using views and have selected the "Views: Filter by an entity reference view" for the Entity Selection Mode.

In my view I have created an Entity Reference Display with a contextual filter. I have tested that the contextual filter works the way I want it to by using "Preview with contextual filters" and entering a sample ID to filter on (1200). It filters just fine.

When I use "Display all results for the specified field when the filter value is not available" all the results display on the node edit form. But as soon as I choose "Provide a default value" -> "Raw Value from URL" then nothing is displayed on the node edit form.

I have checked that the raw value is in the URL: content/assembly/1200 (1200 being the value that works in the "Preview with contextual filters") and am using the right path component to reference it and ticking or unticking "use path alias" makes no difference.

Does anyone know why this would not be working?

Thanks very much.

Comments

Update, If I use Nid I can get the filter to display one value but it should be displaying four values.

It displays four values in the view when I "Preview with contextual filters" but on the actual node itself it only displays the last one that displays on the preview.

same