0

So let's say I have a node for a hotel and a node for a restaurant. I want a list of restaurant nodes that I have explicitly attached to the hotel node using EntityReference. Meaning, there is a field in the restaurant content type that refers to a hotel node.

It seems like I should be able to create a block view that will see what node the user is looking at, and show a list of related nodes, but I haven't been able to get it to work.

I have got a block that shows all restaurants, and have been trying to get contextual filters to work, but any time I try to create a contextual filter, I get this error: "An illegal choice has been detected. Please contact the site administrator." This seems like it should be simple, what am I doing wrong?

SenorPuerco
  • 871
  • 3
  • 9
  • 19

1 Answers1

1

You will need contextual filters for this. I answered a question similar to this here: Way to display those nodes in a view that are related to any other node of a different type

Community
  • 1
  • 1
jsheffers
  • 1,602
  • 19
  • 41
  • That's pretty close to what I did when I got the "illegal choice" error. I'll give your exact answer a try and see if it works for me. Thanks. – SenorPuerco May 31 '12 at 19:37
  • OK, so I followed your instructions on the other question. 1. Create a new view of restaurants in block form. 2. Add a new relationship with the following: "Entity Reference: Referenced Entity - A bridge to the Content entity that is referenced via field_hotel" 3. Add a contextual filter with the following: "Content: Nid - The node ID.", selecting the relationship I just made. 4. Selected "Provide Default Value" of "Content ID from URL". When I click "Apply", I get this error: "An illegal choice has been detected. Please contact the site administrator." Do you think there is a bug? – SenorPuerco Jun 01 '12 at 00:32
  • P.S. I tried it with the latest recommended release and the dev release. – SenorPuerco Jun 01 '12 at 00:34
  • OK, it does appear as if there is a bug of some sort in this form somewhere. When I found the error message in /includes/form.inc and commented out the form_error call, just to see, it worked perfectly. Thanks for your help. – SenorPuerco Jun 01 '12 at 02:31