Change record status: 
Introduced in branch: 
8.x
Description: 

The following functions/hooks have been removed.

field_attach_form()
hook_field_attach_form()
field_attach_extract_form_values()
hook_field_attach_form_values()
field_attach_form_validate()

Use the Entity API instead: https://drupal.org/developing/api/entity

The $form_display argument has been removed from hook_ENTITY_TYPE_prepare_form() and hook_entity_prepare_form().

Impacts: 
Module developers

Comments

Anonymous’s picture

Just to be clear there are no replacement methods for these functions. So by using the Entity API it is meant to alter the form manually in your entity form controller.
For example: I've used hook_field_attach_form() to reorder the form structure. Now I had to create a new method in my entity's form controller for that.

jeroen.b’s picture

You can use EntityFormDisplay to only render the fields:

$display = EntityFormDisplay::collectRenderDisplay($entity, 'default');
$display->buildForm($entity, $form, $form_state);