Is there a hook that could manipulate the list of field items before the field is built? I am currently porting a custom field module from Drupal 7 to 8. The field (Topic Access) has 3 select fields, typically about 10 to 20 items per field, and uses a custom widget. When the form is loaded, I typically insert several &quot;inherited&quot; items to the field before displaying it. When saving, only the items that vary from the inherited ones are actually saved to the database.
In Drupal 7, I used hook_field_load() to add these &quot;inherited&quot; items to the form. As explained on Dynamic/Virtual field values using computed field property classes, that hook has been removed from Drupal 8 in favor of computed field properties.
I can't see an elegant way to manipulate the list of items. I could use hook_form_alter() on the forms that contain the field to update $form['field_topic_access']['widget']. However, it would end up duplicating code from the widget and have to specifically pick out the fields by name.
Is there a hook that could manipulate the list of field items before the field is built?
What about hook_entity_prepare_form()? This simple example loaded an extra item into the form.
function mymodule_entity_prepare_form($entity, $operation, $form_state){
  if ($entity-&gt;bundle() == 'domain_groups') {
    $items = $entity-&gt;get('field_topic_access')-&gt;getValue();
    //just a hardcoded item for test purposes
    $demo_item=['topic_tid'=&gt;'74','available_to_group'=&gt;'1', 'publish_to_group'=&gt;'0'];
    $items[] = $demo_item;
    $entity-&gt;set('field_topic_access', $items);
  }
}

There may be a more elegant solution but I could use this hook to show my inherited items and hook_entity_presave()  to remove inherited values before saving.