I have an entity reference field that is inside of a field_collection (D8) and I need to alter it's views arguments during ajax load to pass in the value from a preceding field on the host entity. I have everything working except I am not sure how to change the handler_settings on the field_collections entity reference.
Node - field_a: contains argument to pass to field_c - field_b: field_collection_item - field_c: entity reference field using a view for it's available options. Need to pass in views arguments to this field's handler_settings whenever I ajax load field_b.
So far I have field_b properly ajaxing in, but I am not sure how to alter the handler_settings. I have this to obtain the current handler_settings:
$field_name = 'field_c'; $bundle_fields = \Drupal::getContainer()->get('entity_field.manager')->getFieldDefinitions('field_collection_item', 'field_b'); $field_definition = $bundle_fields[$field_name]; $field_project_handler_settings = $field_definition->getSetting('handler_settings');
The output of
Thanks in advance!