reverted: --- b/core/lib/Drupal/Core/Entity/ContentEntityFormController.php +++ a/core/lib/Drupal/Core/Entity/ContentEntityFormController.php @@ -50,7 +50,7 @@ $entity = $this->entity; // @todo Exploit the Field API to generate the default widgets for the // entity fields. + if ($entity->getEntityType()->isFieldable()) { - if ($entity->getEntityType()->isExtendable()) { field_attach_form($entity, $form, $form_state, $this->getFormLangcode($form_state)); } @@ -138,7 +138,7 @@ // field API without changing existing entity fields that are not being // edited by this form. Values of fields handled by field API are copied // by field_attach_extract_form_values() below. + $values_excluding_fields = $entity_type->isFieldable() ? array_diff_key($form_state['values'], field_info_instances($entity_type_id, $entity->bundle())) : $form_state['values']; - $values_excluding_fields = $entity_type->isExtendable() ? array_diff_key($form_state['values'], field_info_instances($entity_type_id, $entity->bundle())) : $form_state['values']; $definitions = $entity->getFieldDefinitions(); foreach ($values_excluding_fields as $key => $value) { @@ -155,7 +155,7 @@ } // Invoke field API for copying field values. + if ($entity_type->isFieldable()) { - if ($entity_type->isExtendable()) { field_attach_extract_form_values($entity, $form, $form_state, array('langcode' => $this->getFormLangcode($form_state))); } return $entity; reverted: --- b/core/lib/Drupal/Core/Entity/EntityFormController.php +++ a/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -139,7 +139,7 @@ $entity = $this->entity; // @todo Exploit the Field API to generate the default widgets for the // entity properties. + if ($entity->getEntityType()->isFieldable()) { - if ($entity->getEntityType()->isExtendable()) { field_attach_form($entity, $form, $form_state, $this->getFormLangcode($form_state)); } diff -u b/core/modules/comment/comment.module b/core/modules/comment/comment.module --- b/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -904,7 +904,7 @@ // mismatched types. So, we need to verify that the ID is numeric (even for an // entity type that has an integer ID, $entity->id() might be a string // containing a number), and then cast it to an integer when querying. - if ($entity->getEntityType()->isFieldable() && is_numeric($entity->id())) { + if ($entity->getEntityType()->isExtendable() && is_numeric($entity->id())) { $cids = db_select('comment', 'c') ->fields('c', array('cid')) ->condition('entity_id', (int) $entity->id()) @@ -956,7 +956,7 @@ // mismatched types. So, we need to verify that the ID is numeric (even for an // entity type that has an integer ID, $entity->id() might be a string // containing a number), and then cast it to an integer when querying. - if ($entity->getEntityType()->isExtendable() && is_numeric($entity->id())) { + if ($entity->getEntityType()->isFieldable() && is_numeric($entity->id())) { $cids = db_select('comment', 'c') ->fields('c', array('cid')) ->condition('entity_id', (int) $entity->id()) reverted: --- b/core/modules/field/field.api.php +++ a/core/modules/field/field.api.php @@ -9,13 +9,13 @@ use Drupal\field\FieldConfigUpdateForbiddenException; /** + * Exposes "pseudo-field" components on fieldable entities. - * Exposes "pseudo-field" components on extendable entities. * * Field UI's "Manage fields" and "Manage display" pages let users re-order * fields, but also non-field components. For nodes, these include the title * and other elements exposed by modules through hook_form_alter(). * + * Fieldable entities or modules that want to have their components supported - * Extendable entities or modules that want to have their components supported * should expose them using this hook. The user-defined settings (weight, * visible) are automatically applied on rendered forms and displayed entities * in a #pre_render callback added by field_attach_form() and @@ -82,7 +82,7 @@ } /** + * Alter "pseudo-field" components on fieldable entities. - * Alter "pseudo-field" components on extendable entities. * * @param $info * The associative array of 'pseudo-field' components. reverted: --- b/core/modules/field/field.attach.inc +++ a/core/modules/field/field.attach.inc @@ -2,7 +2,7 @@ /** * @file + * Field attach API, allowing entities (nodes, users, ...) to be 'fieldable'. - * Field attach API, allowing entities (nodes, users, ...) to be 'extendable'. */ use Drupal\Core\Entity\EntityInterface; @@ -19,11 +19,11 @@ * * Field Attach API functions generally take $entity_type and $entity arguments * along with additional function-specific arguments. $entity_type is the type + * of the fieldable entity, such as 'node' or 'user', and $entity is the entity - * of the extendable entity, such as 'node' or 'user', and $entity is the entity * itself. * * An entity plugin's annotation is how entity types define if and how + * Field API should operate on their entity objects. Notably, the 'fieldable' - * Field API should operate on their entity objects. Notably, the 'extendable' * property needs to be set to TRUE. * * The Field Attach API uses the concept of bundles: the set of fields for a reverted: --- b/core/modules/field/field.deprecated.inc +++ a/core/modules/field/field.deprecated.inc @@ -314,7 +314,7 @@ * * This function performs field validation in the context of a form submission. * It converts field validation errors into form errors on the correct form + * elements. Fieldable entity types should call this function during their own - * elements. Extendable entity types should call this function during their own * form validation function. * * @param \Drupal\Core\Entity\ContentEntityInterface $entity only in patch2: unchanged: --- a/core/modules/rest/lib/Drupal/rest/LinkManager/RelationLinkManager.php +++ b/core/modules/rest/lib/Drupal/rest/LinkManager/RelationLinkManager.php @@ -87,7 +87,7 @@ protected function writeCache() { $data = array(); foreach ($this->entityManager->getDefinitions() as $entity_type) { - if ($entity_type->isFieldable()) { + if (in_array('isFieldable', get_class_methods($entity_type))) { foreach ($this->entityManager->getBundleInfo($entity_type->id()) as $bundle => $bundle_info) { foreach ($this->entityManager->getFieldDefinitions($entity_type->id(), $bundle) as $field_definition) { $relation_uri = $this->getRelationUri($entity_type->id(), $bundle, $field_definition->getName());