diff --git a/core/includes/form.inc b/core/includes/form.inc
index aaa8408..3f7e3f9 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -6,6 +6,11 @@
  */
 
 use Drupal\Component\Utility\UrlHelper;
+use Drupal\Component\Utility\Xss;
+use Drupal\Core\Database\Database;
+use Drupal\Core\Form\FormOptionsHelper;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Form\OptGroup;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Render\Element\RenderElement;
 use Drupal\Core\Template\Attribute;
@@ -39,93 +44,11 @@ function template_preprocess_select(&$variables) {
 /**
  * Converts an options form element into a structured array for output.
  *
- * This function calls itself recursively to obtain the values for each optgroup
- * within the list of options and when the function encounters an object with
- * an 'options' property inside $element['#options'].
- *
- * @param array $element
- *   An associative array containing the following key-value pairs:
- *   - #multiple: Optional Boolean indicating if the user may select more than
- *     one item.
- *   - #options: An associative array of options to render as HTML. Each array
- *     value can be a string, an array, or an object with an 'option' property:
- *     - A string or integer key whose value is a translated string is
- *       interpreted as a single HTML option element. Do not use placeholders
- *       that sanitize data: doing so will lead to double-escaping. Note that
- *       the key will be visible in the HTML and could be modified by malicious
- *       users, so don't put sensitive information in it.
- *     - A translated string key whose value is an array indicates a group of
- *       options. The translated string is used as the label attribute for the
- *       optgroup. Do not use placeholders to sanitize data: doing so will lead
- *       to double-escaping. The array should contain the options you wish to
- *       group and should follow the syntax of $element['#options'].
- *     - If the function encounters a string or integer key whose value is an
- *       object with an 'option' property, the key is ignored, the contents of
- *       the option property are interpreted as $element['#options'], and the
- *       resulting HTML is added to the output.
- *   - #value: Optional integer, string, or array representing which option(s)
- *     to pre-select when the list is first displayed. The integer or string
- *     must match the key of an option in the '#options' list. If '#multiple' is
- *     TRUE, this can be an array of integers or strings.
- * @param array|null $choices
- *   (optional) Either an associative array of options in the same format as
- *   $element['#options'] above, or NULL. This parameter is only used internally
- *   and is not intended to be passed in to the initial function call.
- *
- * @return mixed[]
- *   A structured, possibly nested, array of options and optgroups for use in a
- *   select form element.
- *   - label: A translated string whose value is the text of a single HTML
- *     option element, or the label attribute for an optgroup.
- *   - options: Optional, array of options for an optgroup.
- *   - selected: A boolean that indicates whether the option is selected when
- *     rendered.
- *   - type: A string that defines the element type. The value can be 'option'
- *     or 'optgroup'.
- *   - value: A string that contains the value attribute for the option.
+ * @deprecated in Drupal 8.0.x-dev, will be removed before Drupal 8.0.0.
+ *   Use \Drupal\Core\Form\FormOptionsHelper::formSelectOptions().
  */
 function form_select_options($element, $choices = NULL) {
-  if (!isset($choices)) {
-    if (empty($element['#options'])) {
-      return [];
-    }
-    $choices = $element['#options'];
-  }
-  // array_key_exists() accommodates the rare event where $element['#value'] is NULL.
-  // isset() fails in this situation.
-  $value_valid = isset($element['#value']) || array_key_exists('#value', $element);
-  $value_is_array = $value_valid && is_array($element['#value']);
-  // Check if the element is multiple select and no value has been selected.
-  $empty_value = (empty($element['#value']) && !empty($element['#multiple']));
-  $options = [];
-  foreach ($choices as $key => $choice) {
-    if (is_array($choice)) {
-      $options[] = [
-        'type' => 'optgroup',
-        'label' => $key,
-        'options' => form_select_options($element, $choice),
-      ];
-    }
-    elseif (is_object($choice) && isset($choice->option)) {
-      $options = array_merge($options, form_select_options($element, $choice->option));
-    }
-    else {
-      $option = [];
-      $key = (string) $key;
-      $empty_choice = $empty_value && $key == '_none';
-      if ($value_valid && ((!$value_is_array && (string) $element['#value'] === $key || ($value_is_array && in_array($key, $element['#value']))) || $empty_choice)) {
-        $option['selected'] = TRUE;
-      }
-      else {
-        $option['selected'] = FALSE;
-      }
-      $option['type'] = 'option';
-      $option['value'] = $key;
-      $option['label'] = $choice;
-      $options[] = $option;
-    }
-  }
-  return $options;
+  return FormOptionsHelper::formSelectOptions($element, $choices);
 }
 
 /**
diff --git a/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/SelectionBase.php b/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/SelectionBase.php
index 311d309..5998b33 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/SelectionBase.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/SelectionBase.php
@@ -2,8 +2,360 @@
 
 namespace Drupal\Core\Entity\Plugin\EntityReferenceSelection;
 
+use Drupal\Component\Utility\String;
+use Drupal\Core\Database\Query\AlterableInterface;
+use Drupal\Core\Database\Query\SelectInterface;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Form\FormOptionsHelper;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface;
+use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
+use Drupal\Core\Plugin\PluginBase;
+use Drupal\Core\Session\AccountInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 /**
  * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
  *   Use \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection
  */
-class SelectionBase extends DefaultSelection { }
+class SelectionBase extends PluginBase implements SelectionInterface, ContainerFactoryPluginInterface {
+
+  /**
+   * The entity manager.
+   *
+   * @var \Drupal\Core\Entity\EntityManagerInterface
+   */
+  protected $entityManager;
+
+  /**
+   * The module handler service.
+   *
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
+   */
+  protected $moduleHandler;
+
+  /**
+   * The current user.
+   *
+   * @var \Drupal\Core\Session\AccountInterface
+   */
+  protected $currentUser;
+
+  /**
+   * Constructs a new SelectionBase object.
+   *
+   * @param array $configuration
+   *   A configuration array containing information about the plugin instance.
+   * @param string $plugin_id
+   *   The plugin_id for the plugin instance.
+   * @param mixed $plugin_definition
+   *   The plugin implementation definition.
+   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
+   *   The entity manager service.
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
+   *   The module handler service.
+   * @param \Drupal\Core\Session\AccountInterface $current_user
+   *   The current user.
+   */
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, AccountInterface $current_user) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+
+    $this->entityManager = $entity_manager;
+    $this->moduleHandler = $module_handler;
+    $this->currentUser = $current_user;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition,
+      $container->get('entity.manager'),
+      $container->get('module_handler'),
+      $container->get('current_user')
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
+    $entity_type_id = $this->configuration['target_type'];
+    $selection_handler_settings = $this->configuration['handler_settings'];
+    $entity_type = $this->entityManager->getDefinition($entity_type_id);
+    $bundles = $this->entityManager->getBundleInfo($entity_type_id);
+
+    // Merge-in default values.
+    $selection_handler_settings += array(
+      'target_bundles' => array(),
+      'sort' => array(
+        'field' => FormOptionsHelper::OPTIONS_EMPTY_OPTION,
+      ),
+      'auto_create' => FALSE,
+    );
+
+    if ($entity_type->hasKey('bundle')) {
+      $bundle_options = array();
+      foreach ($bundles as $bundle_name => $bundle_info) {
+        $bundle_options[$bundle_name] = $bundle_info['label'];
+      }
+
+      $form['target_bundles'] = array(
+        '#type' => 'checkboxes',
+        '#title' => $this->t('Bundles'),
+        '#options' => $bundle_options,
+        '#default_value' => (!empty($selection_handler_settings['target_bundles'])) ? $selection_handler_settings['target_bundles'] : array(),
+        '#required' => TRUE,
+        '#size' => 6,
+        '#multiple' => TRUE,
+        '#element_validate' => array('_entity_reference_element_validate_filter'),
+      );
+    }
+    else {
+      $form['target_bundles'] = array(
+        '#type' => 'value',
+        '#value' => array(),
+      );
+    }
+
+    if ($entity_type->isSubclassOf('\Drupal\Core\Entity\FieldableEntityInterface')) {
+      $fields = array();
+      foreach (array_keys($bundles) as $bundle) {
+        $bundle_fields = array_filter($this->entityManager->getFieldDefinitions($entity_type_id, $bundle), function ($field_definition) {
+          return !$field_definition->isComputed();
+        });
+        foreach ($bundle_fields as $field_name => $field_definition) {
+          /* @var \Drupal\Core\Field\FieldDefinitionInterface $field_definition */
+          $columns = $field_definition->getFieldStorageDefinition()->getColumns();
+          // If there is more than one column, display them all, otherwise just
+          // display the field label.
+          // @todo: Use property labels instead of the column name.
+          if (count($columns) > 1) {
+            foreach ($columns as $column_name => $column_info) {
+              $fields[$field_name . '.' . $column_name] = $this->t('@label (@column)', array('@label' => $field_definition->getLabel(), '@column' => $column_name));
+            }
+          }
+          else {
+            $fields[$field_name] = $this->t('@label', array('@label' => $field_definition->getLabel()));
+          }
+        }
+      }
+
+      $form['sort']['field'] = array(
+        '#type' => 'select',
+        '#title' => $this->t('Sort by'),
+        '#options' => array(
+          FormOptionsHelper::OPTIONS_EMPTY_OPTION => $this->t('- None -'),
+        ) + $fields,
+        '#ajax' => TRUE,
+        '#limit_validation_errors' => array(),
+        '#default_value' => $selection_handler_settings['sort']['field'],
+      );
+
+      $form['sort']['settings'] = array(
+        '#type' => 'container',
+        '#attributes' => array('class' => array('entity_reference-settings')),
+        '#process' => array('_entity_reference_form_process_merge_parent'),
+      );
+
+      if ($selection_handler_settings['sort']['field'] != FormOptionsHelper::OPTIONS_EMPTY_OPTION) {
+        // Merge-in default values.
+        $selection_handler_settings['sort'] += array(
+          'direction' => 'ASC',
+        );
+
+        $form['sort']['settings']['direction'] = array(
+          '#type' => 'select',
+          '#title' => $this->t('Sort direction'),
+          '#required' => TRUE,
+          '#options' => array(
+            'ASC' => $this->t('Ascending'),
+            'DESC' => $this->t('Descending'),
+          ),
+          '#default_value' => $selection_handler_settings['sort']['direction'],
+        );
+      }
+    }
+
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0) {
+    $target_type = $this->configuration['target_type'];
+
+    $query = $this->buildEntityQuery($match, $match_operator);
+    if ($limit > 0) {
+      $query->range(0, $limit);
+    }
+
+    $result = $query->execute();
+
+    if (empty($result)) {
+      return array();
+    }
+
+    $options = array();
+    $entities = entity_load_multiple($target_type, $result);
+    foreach ($entities as $entity_id => $entity) {
+      $bundle = $entity->bundle();
+      $options[$bundle][$entity_id] = String::checkPlain($entity->label());
+    }
+
+    return $options;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function countReferenceableEntities($match = NULL, $match_operator = 'CONTAINS') {
+    $query = $this->buildEntityQuery($match, $match_operator);
+    return $query
+      ->count()
+      ->execute();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function validateReferenceableEntities(array $ids) {
+    $result = array();
+    if ($ids) {
+      $target_type = $this->configuration['target_type'];
+      $entity_type = $this->entityManager->getDefinition($target_type);
+      $query = $this->buildEntityQuery();
+      $result = $query
+        ->condition($entity_type->getKey('id'), $ids, 'IN')
+        ->execute();
+    }
+
+    return $result;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function validateAutocompleteInput($input, &$element, FormStateInterface $form_state, $form, $strict = TRUE) {
+    $bundled_entities = $this->getReferenceableEntities($input, '=', 6);
+    $entities = array();
+    foreach ($bundled_entities as $entities_list) {
+      $entities += $entities_list;
+    }
+    $params = array(
+      '%value' => $input,
+      '@value' => $input,
+    );
+    if (empty($entities)) {
+      if ($strict) {
+        // Error if there are no entities available for a required field.
+        $form_state->setError($element, $this->t('There are no entities matching "%value".', $params));
+      }
+    }
+    elseif (count($entities) > 5) {
+      $params['@id'] = key($entities);
+      // Error if there are more than 5 matching entities.
+      $form_state->setError($element, $this->t('Many entities are called %value. Specify the one you want by appending the id in parentheses, like "@value (@id)".', $params));
+    }
+    elseif (count($entities) > 1) {
+      // More helpful error if there are only a few matching entities.
+      $multiples = array();
+      foreach ($entities as $id => $name) {
+        $multiples[] = $name . ' (' . $id . ')';
+      }
+      $params['@id'] = $id;
+      $form_state->setError($element, $this->t('Multiple entities match this reference; "%multiple". Specify the one you want by appending the id in parentheses, like "@value (@id)".', array('%multiple' => implode('", "', $multiples))));
+    }
+    else {
+      // Take the one and only matching entity.
+      return key($entities);
+    }
+  }
+
+  /**
+   * Builds an EntityQuery to get referenceable entities.
+   *
+   * @param string|null $match
+   *   (Optional) Text to match the label against. Defaults to NULL.
+   * @param string $match_operator
+   *   (Optional) The operation the matching should be done with. Defaults
+   *   to "CONTAINS".
+   *
+   * @return \Drupal\Core\Entity\Query\QueryInterface
+   *   The EntityQuery object with the basic conditions and sorting applied to
+   *   it.
+   */
+  protected function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
+    $target_type = $this->configuration['target_type'];
+    $handler_settings = $this->configuration['handler_settings'];
+    $entity_type = $this->entityManager->getDefinition($target_type);
+
+    $query = $this->entityManager->getStorage($target_type)->getQuery();
+    if (!empty($handler_settings['target_bundles'])) {
+      $query->condition($entity_type->getKey('bundle'), $handler_settings['target_bundles'], 'IN');
+    }
+
+    if (isset($match) && $label_key = $entity_type->getKey('label')) {
+      $query->condition($label_key, $match, $match_operator);
+    }
+
+    // Add entity-access tag.
+    $query->addTag($target_type . '_access');
+
+    // Add the Selection handler for
+    // entity_reference_query_entity_reference_alter().
+    $query->addTag('entity_reference');
+    $query->addMetaData('entity_reference_selection_handler', $this);
+
+    // Add the sort option.
+    if (!empty($handler_settings['sort'])) {
+      $sort_settings = $handler_settings['sort'];
+      if ($sort_settings['field'] != FormOptionsHelper::OPTIONS_EMPTY_OPTION) {
+        $query->sort($sort_settings['field'], $sort_settings['direction']);
+      }
+    }
+
+    return $query;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function entityQueryAlter(SelectInterface $query) { }
+
+  /**
+   * Helper method: Passes a query to the alteration system again.
+   *
+   * This allows Entity Reference to add a tag to an existing query so it can
+   * ask access control mechanisms to alter it again.
+   */
+  protected function reAlterQuery(AlterableInterface $query, $tag, $base_table) {
+    // Save the old tags and metadata.
+    // For some reason, those are public.
+    $old_tags = $query->alterTags;
+    $old_metadata = $query->alterMetaData;
+
+    $query->alterTags = array($tag => TRUE);
+    $query->alterMetaData['base_table'] = $base_table;
+    $this->moduleHandler->alter(array('query', 'query_' . $tag), $query);
+
+    // Restore the tags and metadata.
+    $query->alterTags = $old_tags;
+    $query->alterMetaData = $old_metadata;
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php
index add9cd7..d49662c 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsWidgetBase.php
@@ -7,6 +7,7 @@
 use Drupal\Core\Field\FieldFilteredMarkup;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormOptionsHelper;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Form\OptGroup;
 
@@ -67,8 +68,8 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
    *   The form state.
    */
   public static function validateElement(array $element, FormStateInterface $form_state) {
-    if ($element['#required'] && $element['#value'] == '_none') {
-      $form_state->setError($element, t('@name field is required.', array('@name' => $element['#title'])));
+    if ($element['#required'] && $element['#value'] == FormOptionsHelper::OPTIONS_EMPTY_OPTION) {
+      $form_state->setError($element, t('!name field is required.', array('!name' => $element['#title'])));
     }
 
     // Massage submitted form values.
@@ -85,7 +86,7 @@ public static function validateElement(array $element, FormStateInterface $form_
 
     // Filter out the 'none' option. Use a strict comparison, because
     // 0 == 'any string'.
-    $index = array_search('_none', $values, TRUE);
+    $index = array_search(FormOptionsHelper::OPTIONS_EMPTY_OPTION, $values, TRUE);
     if ($index !== FALSE) {
       unset($values[$index]);
     }
@@ -116,8 +117,18 @@ protected function getOptions(FieldableEntityInterface $entity) {
         ->getSettableOptions(\Drupal::currentUser());
 
       // Add an empty option if the widget needs one.
-      if ($empty_label = $this->getEmptyLabel()) {
-        $options = ['_none' => $empty_label] + $options;
+      if ($empty_option = $this->getEmptyOption()) {
+        switch ($this->getPluginId()) {
+          case 'options_buttons':
+            $label = t('N/A');
+            break;
+
+          case 'options_select':
+            $label = ($empty_option == static::OPTIONS_EMPTY_NONE ? t('- None -') : t('- Select a value -'));
+            break;
+        }
+
+        $options = array(FormOptionsHelper::OPTIONS_EMPTY_OPTION => $label) + $options;
       }
 
       $module_handler = \Drupal::moduleHandler();
diff --git a/core/lib/Drupal/Core/Form/FormOptionsHelper.php b/core/lib/Drupal/Core/Form/FormOptionsHelper.php
new file mode 100644
index 0000000..e3c2673
--- /dev/null
+++ b/core/lib/Drupal/Core/Form/FormOptionsHelper.php
@@ -0,0 +1,99 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Form\FormOptionsHelper.
+ */
+
+namespace Drupal\Core\Form;
+
+use Drupal\Component\Utility\SafeMarkup;
+
+/**
+ * @todo.
+ */
+class FormOptionsHelper {
+
+  /**
+   * Identifies a 'None' option key.
+   */
+  const OPTIONS_EMPTY_OPTION = '_none';
+
+  /**
+   * Converts an array of options into HTML, for use in select list form elements.
+   *
+   * This function calls itself recursively to obtain the values for each optgroup
+   * within the list of options and when the function encounters an object with
+   * an 'options' property inside $element['#options'].
+   *
+   * @param array $element
+   *   An associative array containing the following key-value pairs:
+   *   - #multiple: Optional Boolean indicating if the user may select more than
+   *     one item.
+   *   - #options: An associative array of options to render as HTML. Each array
+   *     value can be a string, an array, or an object with an 'option' property:
+   *     - A string or integer key whose value is a translated string is
+   *       interpreted as a single HTML option element. Do not use placeholders
+   *       that sanitize data: doing so will lead to double-escaping. Note that
+   *       the key will be visible in the HTML and could be modified by malicious
+   *       users, so don't put sensitive information in it.
+   *     - A translated string key whose value is an array indicates a group of
+   *       options. The translated string is used as the label attribute for the
+   *       optgroup. Do not use placeholders to sanitize data: doing so will lead
+   *       to double-escaping. The array should contain the options you wish to
+   *       group and should follow the syntax of $element['#options'].
+   *     - If the function encounters a string or integer key whose value is an
+   *       object with an 'option' property, the key is ignored, the contents of
+   *       the option property are interpreted as $element['#options'], and the
+   *       resulting HTML is added to the output.
+   *   - #value: Optional integer, string, or array representing which option(s)
+   *     to pre-select when the list is first displayed. The integer or string
+   *     must match the key of an option in the '#options' list. If '#multiple' is
+   *     TRUE, this can be an array of integers or strings.
+   * @param array|null $choices
+   *   (optional) Either an associative array of options in the same format as
+   *   $element['#options'] above, or NULL. This parameter is only used internally
+   *   and is not intended to be passed in to the initial function call.
+   *
+   * @return string
+   *   An HTML string of options and optgroups for use in a select form element.
+   */
+  public static function formSelectOptions(array $element, $choices = NULL) {
+    if (!isset($choices)) {
+      if (empty($element['#options'])) {
+        return '';
+      }
+      $choices = $element['#options'];
+    }
+    // array_key_exists() accommodates the rare event where $element['#value'] is NULL.
+    // isset() fails in this situation.
+    $value_valid = isset($element['#value']) || array_key_exists('#value', $element);
+    $value_is_array = $value_valid && is_array($element['#value']);
+    // Check if the element is multiple select and no value has been selected.
+    $empty_value = (empty($element['#value']) && !empty($element['#multiple']));
+    $options = '';
+    foreach ($choices as $key => $choice) {
+      if (is_array($choice)) {
+        $options .= '<optgroup label="' . SafeMarkup::checkPlain($key) . '">';
+        $options .= static::formSelectOptions($element, $choice);
+        $options .= '</optgroup>';
+      }
+      elseif (is_object($choice) && isset($choice->option)) {
+        $options .= static::formSelectOptions($element, $choice->option);
+      }
+      else {
+        $key = (string) $key;
+        $empty_choice = $empty_value && $key == static::OPTIONS_EMPTY_OPTION;
+        if ($value_valid && ((!$value_is_array && (string) $element['#value'] === $key || ($value_is_array && in_array($key, $element['#value']))) || $empty_choice)) {
+          $selected = ' selected="selected"';
+        }
+        else {
+          $selected = '';
+        }
+        $options .= '<option value="' . SafeMarkup::checkPlain($key) . '"' . $selected . '>' . SafeMarkup::checkPlain($choice) . '</option>';
+      }
+    }
+    return SafeMarkup::set($options);
+  }
+
+}
diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceAdminTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceAdminTest.php
new file mode 100644
index 0000000..d8efae5
--- /dev/null
+++ b/core/modules/entity_reference/src/Tests/EntityReferenceAdminTest.php
@@ -0,0 +1,308 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\entity_reference\Tests\EntityReferenceAdminTest.
+ */
+
+namespace Drupal\entity_reference\Tests;
+
+use Drupal\Core\Form\FormOptionsHelper;
+use Drupal\field_ui\Tests\FieldUiTestTrait;
+use Drupal\simpletest\WebTestBase;
+use Drupal\taxonomy\Entity\Vocabulary;
+
+/**
+ * Tests for the administrative UI.
+ *
+ * @group entity_reference
+ */
+class EntityReferenceAdminTest extends WebTestBase {
+
+  use FieldUiTestTrait;
+
+  /**
+   * Modules to install.
+   *
+   * Enable path module to ensure that the selection handler does not fail for
+   * entities with a path field.
+   *
+   * @var array
+   */
+  public static $modules = array('node', 'field_ui', 'entity_reference', 'path', 'taxonomy', 'block', 'views');
+
+
+  /**
+   * The name of the content type created for testing purposes.
+   *
+   * @var string
+   */
+  protected $type;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->drupalPlaceBlock('system_breadcrumb_block');
+
+    // Create test user.
+    $admin_user = $this->drupalCreateUser(array('access content', 'administer node fields', 'administer node display'));
+    $this->drupalLogin($admin_user);
+
+    // Create a content type, with underscores.
+    $type_name = strtolower($this->randomMachineName(8)) . '_test';
+    $type = $this->drupalCreateContentType(array('name' => $type_name, 'type' => $type_name));
+    $this->type = $type->id();
+  }
+
+  /**
+   * Tests the Entity Reference Admin UI.
+   */
+  public function testFieldAdminHandler() {
+    $bundle_path = 'admin/structure/types/manage/' . $this->type;
+
+    // First step: 'Add new field' on the 'Manage fields' page.
+    $this->drupalGet($bundle_path . '/fields/add-field');
+
+    // Check if the commonly referenced entity types appear in the list.
+    $this->assertOption('edit-new-storage-type', 'field_ui:entity_reference:node');
+    $this->assertOption('edit-new-storage-type', 'field_ui:entity_reference:user');
+
+    $this->drupalPostForm(NULL, array(
+      'label' => 'Test label',
+      'field_name' => 'test',
+      'new_storage_type' => 'entity_reference',
+    ), t('Save and continue'));
+
+    // Node should be selected by default.
+    $this->assertFieldByName('field_storage[settings][target_type]', 'node');
+
+    // Check that all entity types can be referenced.
+    $this->assertFieldSelectOptions('field_storage[settings][target_type]', array_keys(\Drupal::entityManager()->getDefinitions()));
+
+    // Second step: 'Field settings' form.
+    $this->drupalPostForm(NULL, array(), t('Save field settings'));
+
+    // The base handler should be selected by default.
+    $this->assertFieldByName('field[settings][handler]', 'default:node');
+
+    // The base handler settings should be displayed.
+    $entity_type_id = 'node';
+    $bundles = entity_get_bundles($entity_type_id);
+    foreach ($bundles as $bundle_name => $bundle_info) {
+      $this->assertFieldByName('field[settings][handler_settings][target_bundles][' . $bundle_name . ']');
+    }
+
+    reset($bundles);
+
+    // Test the sort settings.
+    // Option 0: no sort.
+    $this->assertFieldByName('field[settings][handler_settings][sort][field]', FormOptionsHelper::OPTIONS_EMPTY_OPTION);
+    $this->assertNoFieldByName('field[settings][handler_settings][sort][direction]');
+    // Option 1: sort by field.
+    $this->drupalPostAjaxForm(NULL, array('field[settings][handler_settings][sort][field]' => 'nid'), 'field[settings][handler_settings][sort][field]');
+    $this->assertFieldByName('field[settings][handler_settings][sort][direction]', 'ASC');
+
+    // Test that a non-translatable base field is a sort option.
+    $this->assertFieldByXPath("//select[@name='field[settings][handler_settings][sort][field]']/option[@value='nid']");
+    // Test that a translatable base field is a sort option.
+    $this->assertFieldByXPath("//select[@name='field[settings][handler_settings][sort][field]']/option[@value='title']");
+    // Test that a configurable field is a sort option.
+    $this->assertFieldByXPath("//select[@name='field[settings][handler_settings][sort][field]']/option[@value='body.value']");
+
+    // Set back to no sort.
+    $this->drupalPostAjaxForm(NULL, array('field[settings][handler_settings][sort][field]' => FormOptionsHelper::OPTIONS_EMPTY_OPTION), 'field[settings][handler_settings][sort][field]');
+    $this->assertNoFieldByName('field[settings][handler_settings][sort][direction]');
+
+    // Third step: confirm.
+    $this->drupalPostForm(NULL, array(
+      'field[required]' => '1',
+      'field[settings][handler_settings][target_bundles][' . key($bundles) . ']' => key($bundles),
+    ), t('Save settings'));
+
+    // Check that the field appears in the overview form.
+    $this->assertFieldByXPath('//table[@id="field-overview"]//tr[@id="field-test"]/td[1]', 'Test label', 'Field was created and appears in the overview page.');
+
+    // Check that the field settings form can be submitted again, even when the
+    // field is required.
+    // The first 'Edit' link is for the Body field.
+    $this->clickLink(t('Edit'), 1);
+    $this->drupalPostForm(NULL, array(), t('Save settings'));
+
+    // Switch the target type to 'taxonomy_term' and check that the settings
+    // specific to its selection handler are displayed.
+    $field_name = 'node.' . $this->type . '.field_test';
+    $edit = array(
+      'field_storage[settings][target_type]' => 'taxonomy_term',
+    );
+    $this->drupalPostForm($bundle_path . '/fields/' . $field_name . '/storage', $edit, t('Save field settings'));
+    $this->drupalGet($bundle_path . '/fields/' . $field_name);
+    $this->assertFieldByName('field[settings][handler_settings][auto_create]');
+
+    // Switch the target type to 'user' and check that the settings specific to
+    // its selection handler are displayed.
+    $field_name = 'node.' . $this->type . '.field_test';
+    $edit = array(
+      'field_storage[settings][target_type]' => 'user',
+    );
+    $this->drupalPostForm($bundle_path . '/fields/' . $field_name . '/storage', $edit, t('Save field settings'));
+    $this->drupalGet($bundle_path . '/fields/' . $field_name);
+    $this->assertFieldByName('field[settings][handler_settings][filter][type]', FormOptionsHelper::OPTIONS_EMPTY_OPTION);
+
+    // Try to select the views handler.
+    $edit = array(
+      'field[settings][handler]' => 'views',
+    );
+    $this->drupalPostAjaxForm($bundle_path . '/fields/' . $field_name, $edit, 'field[settings][handler]');
+    $this->drupalPostForm(NULL, $edit, t('Save settings'));
+    $this->assertResponse(200);
+  }
+
+
+  /**
+   * Tests the formatters for the Entity References
+   */
+  public function testAvailableFormatters() {
+    // Create a new vocabulary.
+    Vocabulary::create(array('vid' => 'tags', 'name' => 'tags'))->save();
+
+    // Create entity reference field with taxonomy term as a target.
+    $taxonomy_term_field_name = $this->createEntityReferenceField('taxonomy_term', 'tags');
+
+    // Create entity reference field with user as a target.
+    $user_field_name = $this->createEntityReferenceField('user');
+
+    // Create entity reference field with node as a target.
+    $node_field_name = $this->createEntityReferenceField('node', $this->type);
+
+    // Create entity reference field with date format as a target.
+    $date_format_field_name = $this->createEntityReferenceField('date_format');
+
+    // Display all newly created Entity Reference configuration.
+    $this->drupalGet('admin/structure/types/manage/' . $this->type . '/display');
+
+    // Check for Taxonomy Term select box values.
+    // Test if Taxonomy Term Entity Reference Field has the correct formatters.
+    $this->assertFieldSelectOptions('fields[field_' . $taxonomy_term_field_name . '][type]', array(
+      'entity_reference_label',
+      'entity_reference_entity_id',
+      'entity_reference_rss_category',
+      'entity_reference_entity_view',
+      'hidden',
+    ));
+
+    // Test if User Reference Field has the correct formatters.
+    // Author should be available for this field.
+    // RSS Category should not be available for this field.
+    $this->assertFieldSelectOptions('fields[field_' . $user_field_name . '][type]', array(
+      'author',
+      'entity_reference_entity_id',
+      'entity_reference_entity_view',
+      'entity_reference_label',
+      'hidden',
+    ));
+
+    // Test if Node Entity Reference Field has the correct formatters.
+    // RSS Category should not be available for this field.
+    $this->assertFieldSelectOptions('fields[field_' . $node_field_name . '][type]', array(
+      'entity_reference_label',
+      'entity_reference_entity_id',
+      'entity_reference_entity_view',
+      'hidden',
+    ));
+
+    // Test if Date Format Reference Field has the correct formatters.
+    // RSS Category & Entity View should not be available for this field.
+    // This could be any field without a ViewBuilder.
+    $this->assertFieldSelectOptions('fields[field_' . $date_format_field_name . '][type]', array(
+      'entity_reference_label',
+      'entity_reference_entity_id',
+      'hidden',
+    ));
+  }
+
+  /**
+   * Creates a new Entity Reference fields with a given target type.
+   *
+   * @param $target_type
+   *   The name of the target type
+   * @param $bundle
+   *   Name of the bundle
+   *   Default = NULL
+   * @return string
+   *   Returns the generated field name
+   */
+  public function createEntityReferenceField($target_type, $bundle = NULL) {
+    // Generates a bundle path for the newly created content type.
+    $bundle_path = 'admin/structure/types/manage/' . $this->type;
+
+    // Generate a random field name, must be only lowercase characters.
+    $field_name = strtolower($this->randomMachineName());
+
+    $storage_edit = $field_edit = array();
+    $storage_edit['field_storage[settings][target_type]'] = $target_type;
+    if ($bundle) {
+      $field_edit['field[settings][handler_settings][target_bundles][' . $bundle . ']'] = TRUE;
+    }
+
+    $this->fieldUIAddNewField($bundle_path, $field_name, NULL, 'entity_reference', $storage_edit, $field_edit);
+
+    // Returns the generated field name.
+    return $field_name;
+  }
+
+
+  /**
+   * Checks if a select element contains the specified options.
+   *
+   * @param string $name
+   *   The field name.
+   * @param array $expected_options
+   *   An array of expected options.
+   *
+   * @return bool
+   *   TRUE if the assertion succeeded, FALSE otherwise.
+   */
+  protected function assertFieldSelectOptions($name, array $expected_options) {
+    $xpath = $this->buildXPathQuery('//select[@name=:name]', array(':name' => $name));
+    $fields = $this->xpath($xpath);
+    if ($fields) {
+      $field = $fields[0];
+      $options = $this->getAllOptionsList($field);
+
+      sort($options);
+      sort($expected_options);
+
+      return $this->assertIdentical($options, $expected_options);
+    }
+    else {
+      return $this->fail('Unable to find field ' . $name);
+    }
+  }
+
+  /**
+   * Extracts all options from a select element.
+   *
+   * @param \SimpleXMLElement $element
+   *   The select element field information.
+   *
+   * @return array
+   *   An array of option values as strings.
+   */
+  protected function getAllOptionsList(\SimpleXMLElement $element) {
+    $options = array();
+    // Add all options items.
+    foreach ($element->option as $option) {
+      $options[] = (string) $option['value'];
+    }
+
+    // Loops trough all the option groups
+    foreach ($element->optgroup as $optgroup) {
+      $options = array_merge($this->getAllOptionsList($optgroup), $options);
+    }
+
+    return $options;
+  }
+
+}
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php
index 6433958..b35aeb8 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFieldDefaultValueTest.php
@@ -5,6 +5,7 @@
 use Drupal\Component\Utility\Unicode;
 use Drupal\config\Tests\SchemaCheckTestTrait;
 use Drupal\field\Entity\FieldConfig;
+use Drupal\Core\Form\FormOptionsHelper;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\node\Entity\Node;
 use Drupal\simpletest\WebTestBase;
@@ -66,7 +67,7 @@ function testEntityReferenceDefaultValue() {
         'handler' => 'default',
         'handler_settings' => array(
           'target_bundles' => array('referenced_content'),
-          'sort' => array('field' => '_none'),
+          'sort' => array('field' => FormOptionsHelper::OPTIONS_EMPTY_OPTION),
         ),
       ),
     ]);
@@ -129,7 +130,7 @@ function testEntityReferenceDefaultConfigValue() {
       'settings' => array(
         'handler' => 'default',
         'handler_settings' => array(
-          'sort' => array('field' => '_none'),
+          'sort' => array('field' => FormOptionsHelper::OPTIONS_EMPTY_OPTION),
         ),
       ),
     ]);
diff --git a/core/modules/options/options.api.php b/core/modules/options/options.api.php
index a4ac605..592e7ea 100644
--- a/core/modules/options/options.api.php
+++ b/core/modules/options/options.api.php
@@ -7,6 +7,7 @@
 
 use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
+use Drupal\Core\Form\FormOptionsHelper;
 
 /**
  * Alters the list of options to be displayed for a field.
@@ -32,7 +33,7 @@ function hook_options_list_alter(array &$options, array $context) {
   // Check if this is the field we want to change.
   if ($context['field']->id() == 'field_option') {
     // Change the label of the empty option.
-    $options['_none'] = t('== Empty ==');
+    $options[FormOptionsHelper::OPTIONS_EMPTY_OPTION] = t('== Empty ==');
   }
 }
 
diff --git a/core/modules/options/src/Tests/OptionsSelectDynamicValuesTest.php b/core/modules/options/src/Tests/OptionsSelectDynamicValuesTest.php
index df3365c..b37c978 100644
--- a/core/modules/options/src/Tests/OptionsSelectDynamicValuesTest.php
+++ b/core/modules/options/src/Tests/OptionsSelectDynamicValuesTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\options\Tests;
 
+use Drupal\Core\Form\FormOptionsHelper;
+
 /**
  * Tests an options select with a dynamic allowed values function.
  *
@@ -25,7 +27,7 @@ function testSelectListDynamic() {
     $this->assertEqual(count($options), count($this->test) + 1);
     foreach ($options as $option) {
       $value = (string) $option['value'];
-      if ($value != '_none') {
+      if ($value != FormOptionsHelper::OPTIONS_EMPTY_OPTION) {
         $this->assertTrue(array_search($value, $this->test));
       }
     }
diff --git a/core/modules/options/src/Tests/OptionsWidgetsTest.php b/core/modules/options/src/Tests/OptionsWidgetsTest.php
index 23f0f0d..47798ee 100644
--- a/core/modules/options/src/Tests/OptionsWidgetsTest.php
+++ b/core/modules/options/src/Tests/OptionsWidgetsTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\entity_test\Entity\EntityTest;
 use Drupal\field\Entity\FieldConfig;
+use Drupal\Core\Form\FormOptionsHelper;
 use Drupal\field\Tests\FieldTestBase;
 use Drupal\field\Entity\FieldStorageConfig;
 
@@ -125,7 +126,7 @@ function testRadioButtons() {
     $this->assertNoFieldChecked('edit-card-1-2');
 
     // Unselect option.
-    $edit = array('card_1' => '_none');
+    $edit = array('card_1' => FormOptionsHelper::OPTIONS_EMPTY_OPTION);
     $this->drupalPostForm(NULL, $edit, t('Save'));
     $this->assertFieldValues($entity_init, 'card_1', array());
 
@@ -255,17 +256,17 @@ function testSelectListSingle() {
     // Display form.
     $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     // A required field without any value has a "none" option.
-    $this->assertTrue($this->xpath('//select[@id=:id]//option[@value="_none" and text()=:label]', array(':id' => 'edit-card-1', ':label' => t('- Select a value -'))), 'A required select list has a "Select a value" choice.');
+    $this->assertTrue($this->xpath('//select[@id=:id]//option[@value=:value and text()=:label]', array(':id' => 'edit-card-1', ':value' => FormOptionsHelper::OPTIONS_EMPTY_OPTION, ':label' => t('- Select a value -'))), 'A required select list has a "Select a value" choice.');
 
     // With no field data, nothing is selected.
-    $this->assertNoOptionSelected('edit-card-1', '_none');
+    $this->assertNoOptionSelected('edit-card-1', FormOptionsHelper::OPTIONS_EMPTY_OPTION);
     $this->assertNoOptionSelected('edit-card-1', 0);
     $this->assertNoOptionSelected('edit-card-1', 1);
     $this->assertNoOptionSelected('edit-card-1', 2);
     $this->assertRaw('Some dangerous &amp; unescaped markup', 'Option text was properly filtered.');
 
     // Submit form: select invalid 'none' option.
-    $edit = array('card_1' => '_none');
+    $edit = array('card_1' => FormOptionsHelper::OPTIONS_EMPTY_OPTION);
     $this->drupalPostForm(NULL, $edit, t('Save'));
     $this->assertRaw(t('@title field is required.', array('@title' => $field->getName())), 'Cannot save a required field when selecting "none" from the select list.');
 
@@ -277,7 +278,7 @@ function testSelectListSingle() {
     // Display form: check that the right options are selected.
     $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     // A required field with a value has no 'none' option.
-    $this->assertFalse($this->xpath('//select[@id=:id]//option[@value="_none"]', array(':id' => 'edit-card-1')), 'A required select list with an actual value has no "none" choice.');
+    $this->assertFalse($this->xpath('//select[@id=:id]//option[@value=:value]', array(':id' => 'edit-card-1', ':value' => FormOptionsHelper::OPTIONS_EMPTY_OPTION)), 'A required select list with an actual value has no "none" choice.');
     $this->assertOptionSelected('edit-card-1', 0);
     $this->assertNoOptionSelected('edit-card-1', 1);
     $this->assertNoOptionSelected('edit-card-1', 2);
@@ -289,10 +290,10 @@ function testSelectListSingle() {
     // Display form.
     $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     // A non-required field has a 'none' option.
-    $this->assertTrue($this->xpath('//select[@id=:id]//option[@value="_none" and text()=:label]', array(':id' => 'edit-card-1', ':label' => t('- None -'))), 'A non-required select list has a "None" choice.');
+    $this->assertTrue($this->xpath('//select[@id=:id]//option[@value=:value and text()=:label]', array(':id' => 'edit-card-1', ':value' => FormOptionsHelper::OPTIONS_EMPTY_OPTION, ':label' => t('- None -'))), 'A non-required select list has a "None" choice.');
     // Submit form: Unselect the option.
-    $edit = array('card_1' => '_none');
-    $this->drupalPostForm('entity_test/manage/' . $entity->id() . '/edit', $edit, t('Save'));
+    $edit = array('card_1' => FormOptionsHelper::OPTIONS_EMPTY_OPTION);
+    $this->drupalPostForm('entity_test/manage/' . $entity->id(), $edit, t('Save'));
     $this->assertFieldValues($entity_init, 'card_1', array());
 
     // Test optgroups.
@@ -322,8 +323,8 @@ function testSelectListSingle() {
     $this->assertNoOptionSelected('edit-card-1', 2);
 
     // Submit form: Unselect the option.
-    $edit = array('card_1' => '_none');
-    $this->drupalPostForm('entity_test/manage/' . $entity->id() . '/edit', $edit, t('Save'));
+    $edit = array('card_1' => FormOptionsHelper::OPTIONS_EMPTY_OPTION);
+    $this->drupalPostForm('entity_test/manage/' . $entity->id(), $edit, t('Save'));
     $this->assertFieldValues($entity_init, 'card_1', array());
   }
 
@@ -352,8 +353,8 @@ function testSelectListMultiple() {
     $entity_init = clone $entity;
 
     // Display form: with no field data, nothing is selected.
-    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
-    $this->assertOptionSelected("edit-card-2", '_none');
+    $this->drupalGet('entity_test/manage/' . $entity->id());
+    $this->assertOptionSelected("edit-card-2", FormOptionsHelper::OPTIONS_EMPTY_OPTION);
     $this->assertNoOptionSelected('edit-card-2', 0);
     $this->assertNoOptionSelected('edit-card-2', 1);
     $this->assertNoOptionSelected('edit-card-2', 2);
@@ -395,13 +396,13 @@ function testSelectListMultiple() {
 
     // Check that the 'none' option has no effect if actual options are selected
     // as well.
-    $edit = array('card_2[]' => array('_none' => '_none', 0 => 0));
-    $this->drupalPostForm('entity_test/manage/' . $entity->id() . '/edit', $edit, t('Save'));
+    $edit = array('card_2[]' => array(FormOptionsHelper::OPTIONS_EMPTY_OPTION => FormOptionsHelper::OPTIONS_EMPTY_OPTION, 0 => 0));
+    $this->drupalPostForm('entity_test/manage/' . $entity->id(), $edit, t('Save'));
     $this->assertFieldValues($entity_init, 'card_2', array(0));
 
     // Check that selecting the 'none' option empties the field.
-    $edit = array('card_2[]' => array('_none' => '_none'));
-    $this->drupalPostForm('entity_test/manage/' . $entity->id() . '/edit', $edit, t('Save'));
+    $edit = array('card_2[]' => array(FormOptionsHelper::OPTIONS_EMPTY_OPTION => FormOptionsHelper::OPTIONS_EMPTY_OPTION));
+    $this->drupalPostForm('entity_test/manage/' . $entity->id(), $edit, t('Save'));
     $this->assertFieldValues($entity_init, 'card_2', array());
 
     // A required select list does not have an empty key.
@@ -443,8 +444,8 @@ function testSelectListMultiple() {
     $this->assertNoOptionSelected('edit-card-2', 2);
 
     // Submit form: Unselect the option.
-    $edit = array('card_2[]' => array('_none' => '_none'));
-    $this->drupalPostForm('entity_test/manage/' . $entity->id() . '/edit', $edit, t('Save'));
+    $edit = array('card_2[]' => array(FormOptionsHelper::OPTIONS_EMPTY_OPTION => FormOptionsHelper::OPTIONS_EMPTY_OPTION));
+    $this->drupalPostForm('entity_test/manage/' . $entity->id(), $edit, t('Save'));
     $this->assertFieldValues($entity_init, 'card_2', array());
   }
 
diff --git a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
index e02917d..f83986b 100644
--- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
+++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php
@@ -6,7 +6,7 @@
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\EventSubscriber\MainContentViewSubscriber;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
-use Drupal\Core\Language\LanguageInterface;
+use Drupal\Core\Form\FormOptionsHelper;
 use Drupal\Core\Url;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\field\Entity\FieldConfig;
@@ -260,7 +260,7 @@ protected function createReferenceTestEntities($referenced_entity) {
           'target_bundles' => array(
             $referenced_entity->bundle() => $referenced_entity->bundle(),
           ),
-          'sort' => array('field' => '_none'),
+          'sort' => array('field' => FormOptionsHelper::OPTIONS_EMPTY_OPTION),
           'auto_create' => FALSE,
         ),
       ),
diff --git a/core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php b/core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php
index 8dfba39..3c3852b 100644
--- a/core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php
+++ b/core/modules/user/src/Plugin/EntityReferenceSelection/UserSelection.php
@@ -7,6 +7,7 @@
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Form\FormOptionsHelper;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\user\RoleInterface;
@@ -88,7 +89,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
     // Merge in default values.
     $selection_handler_settings += array(
       'filter' => array(
-        'type' => '_none',
+        'type' => FormOptionsHelper::OPTIONS_EMPTY_OPTION,
       ),
       'include_anonymous' => TRUE,
     );
@@ -104,7 +105,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
       '#type' => 'select',
       '#title' => $this->t('Filter by'),
       '#options' => array(
-        '_none' => $this->t('- None -'),
+        FormOptionsHelper::OPTIONS_EMPTY_OPTION => $this->t('- None -'),
         'role' => $this->t('User role'),
       ),
       '#ajax' => TRUE,
