diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php
index 6a8df6f..401ff12 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/widget/AutocompleteWidgetBase.php
@@ -55,7 +55,7 @@ public function settingsForm(array $form, array &$form_state) {
   public function formElement(array $items, $delta, array $element, $langcode, array &$form, array &$form_state) {
     $instance = $this->instance;
     $field = $this->field;
-    $entity = isset($element['#entity']) ? $element['#entity'] : NULL;
+    $entity = isset($form_state['entity']) ? $form_state['entity'] : NULL;
 
     // Prepare the autocomplete path.
     $autocomplete_path = $this->getSetting('autocomplete_path');
diff --git a/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetBase.php b/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetBase.php
index b60552e..5743874 100644
--- a/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetBase.php
+++ b/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetBase.php
@@ -270,10 +270,10 @@ protected function formSingleElement(EntityInterface $entity, array $items, $del
     $instance = $this->instance;
     $field = $this->field;
 
+    $form_state['entity'] = $entity;
     $element += array(
       '#entity_type' => $entity->entityType(),
       '#bundle' => $entity->bundle(),
-      '#entity' => $entity,
       '#field_name' => $field['field_name'],
       '#language' => $langcode,
       '#field_parents' => $form['#parents'],
diff --git a/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetInterface.php b/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetInterface.php
index c0ffc95..728f96d 100644
--- a/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetInterface.php
+++ b/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetInterface.php
@@ -77,7 +77,6 @@ public function settingsForm(array $form, array &$form_state);
    *   A form element array containing basic properties for the widget:
    *   - #entity_type: The name of the entity the field is attached to.
    *   - #bundle: The name of the field bundle the field is contained in.
-   *   - #entity: The entity the field is attached to.
    *   - #field_name: The name of the field.
    *   - #language: The language the field is being edited in.
    *   - #field_parents: The 'parents' space for the field in the form. Most
@@ -102,7 +101,8 @@ public function settingsForm(array $form, array &$form_state);
    *   The form structure where widgets are being attached to. This might be a
    *   full form structure, or a sub-element of a larger form.
    * @param string $form_state
-   *   An associative array containing the current state of the form.
+   *   An associative array containing the current state of the form. Of
+   *   particular interest is the key 'entity' holding the entity.
    *
    * @return array
    *   The form elements for a single widget for this field.
diff --git a/core/modules/field_ui/field_ui.admin.inc b/core/modules/field_ui/field_ui.admin.inc
index 566959b..9dfefca 100644
--- a/core/modules/field_ui/field_ui.admin.inc
+++ b/core/modules/field_ui/field_ui.admin.inc
@@ -794,8 +794,8 @@ function field_ui_field_edit_form($form, &$form_state, $instance) {
   $form['#instance'] = $instance;
   // Create an arbitrary entity object (used by the 'default value' widget).
   $ids = (object) array('entity_type' => $instance['entity_type'], 'bundle' => $instance['bundle'], 'entity_id' => NULL);
-  $form['#entity'] = _field_create_entity_from_ids($ids);
-  $form['#entity']->field_ui_default_value = TRUE;
+  $form_state['entity'] = _field_create_entity_from_ids($ids);
+  $form_state['entity']->field_ui_default_value = TRUE;
 
   if (!empty($field['locked'])) {
     $form['locked'] = array(
@@ -916,7 +916,7 @@ function field_ui_field_edit_form_delete_submit($form, &$form_state) {
  */
 function field_ui_default_value_widget($field, $instance, &$form, &$form_state) {
   $field_name = $field['field_name'];
-  $entity = $form['#entity'];
+  $entity = $form_state['entity'];
 
   $element = array(
     '#type' => 'details',
@@ -952,7 +952,7 @@ function field_ui_field_edit_form_validate($form, &$form_state) {
   // value' gets validated using the instance settings being submitted.
   $instance = $form['#instance'];
   $field_name = $instance['field_name'];
-  $entity = $form['#entity'];
+  $entity = $form_state['entity'];
 
   if (isset($form['instance']['default_value_widget'])) {
     $element = $form['instance']['default_value_widget'];
@@ -992,7 +992,7 @@ function field_ui_field_edit_form_validate($form, &$form_state) {
 function field_ui_field_edit_form_submit($form, &$form_state) {
   $instance = $form['#instance'];
   $field = $form['#field'];
-  $entity = $form['#entity'];
+  $entity = $form_state['entity'];
 
   // Handle the default value.
   if (isset($form['instance']['default_value_widget'])) {
diff --git a/core/modules/link/link.module b/core/modules/link/link.module
index 57d744c..659dcec 100644
--- a/core/modules/link/link.module
+++ b/core/modules/link/link.module
@@ -162,7 +162,7 @@ function link_field_widget_form(&$form, &$form_state, $field, $instance, $langco
   // Post-process the title field to make it conditionally required if URL is
   // non-empty. Omit the validation on the field edit form, since the field
   // settings cannot be saved otherwise.
-  $is_field_edit_form = ($element['#entity'] === NULL);
+  $is_field_edit_form = !isset($form_state['entity']);
   if (!$is_field_edit_form && $settings['title'] == DRUPAL_REQUIRED) {
     $element['#element_validate'][] = 'link_field_widget_validate_title';
   }
diff --git a/core/modules/options/options.module b/core/modules/options/options.module
index 793b07e..a2496bf 100644
--- a/core/modules/options/options.module
+++ b/core/modules/options/options.module
@@ -486,7 +486,7 @@ function options_field_widget_form(&$form, &$form_state, $field, $instance, $lan
   $properties = _options_properties($type, $multiple, $required, $has_value);
 
   $entity_type = $element['#entity_type'];
-  $entity = $element['#entity'];
+  $entity = $form_state['entity'];
 
   // Prepare the list of options.
   $options = _options_get_options($field, $instance, $properties, $entity);
