hook_form_alter() "og_group_ref" editable field's #options? I've hit a problem using one og_group_ref field over multiple content types. I need to have the field editable for one content type in a view and provide the select list options from another view.

At the moment, I have the editable field in the view showing all nodes for all content types as options which isn't acceptable. A new field isn't an option.

Editable Fields
Content type: course_students
Field: og_group_ref
View: resources > panel_pane_2
View providing nodes: abc > def

I've been away from Drupal for a couple of months and am completely lost so any help with a custom module to give this functionality would be greatly appreciated.

The below image shows the current problem where two content types are in the drop down list. This list instead needs to have nodes provided by a view.
It's not a form alter but it's an easy solution using rules.. I added a second entity reference field that only listed the nodes I wanted. Then I used two rules to make sure the two fields always match, whichever is updated.

This is one of the rules for when og_group_ref changes. The other one is the same except for when the second entity reference field changes.



Why am I posting this as a solution when it's different to the question? Because it's very quick, most people use rules and it's applicable in many situations.