I have 2 content types business, locations, programs and services.
At program level we select all the services associated with that program.
At business level we select the programs the business is associated with.
At the location level based on the programs selected we give the option to sub select the services.
Now the services entity reference is displayed via Entity Reference View Widget. All I want to do is alter or unset certain options based on the choices made at the business level in terms of program selection.
I tried working at the views level to pass it as an argument but was unsuccessful. Then tried the node form alter but the unset option still shows up but without the checkbox.
Tried to alter it using hook_field_widget_form_alter as well but was not successful.
It looks like it implements a preprocess function entityreference_view_widget_preprocess_widget but I am not able to override it.
Looking for pointers if anyone has come across similar problem.