diff --git a/core/lib/Drupal/Core/Entity/ContentEntityFormController.php b/core/lib/Drupal/Core/Entity/ContentEntityFormController.php index 0383533..a5df3d2 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityFormController.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityFormController.php @@ -50,7 +50,7 @@ public function form(array $form, array &$form_state) { $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 @@ public function buildEntity(array $form, array &$form_state) { // 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 @@ public function buildEntity(array $form, array &$form_state) { } // 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; diff --git a/core/lib/Drupal/Core/Entity/EntityFormController.php b/core/lib/Drupal/Core/Entity/EntityFormController.php index 58d9035..8d236ee 100644 --- a/core/lib/Drupal/Core/Entity/EntityFormController.php +++ b/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -139,7 +139,7 @@ public function form(array $form, array &$form_state) { $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 --git a/core/lib/Drupal/Core/Entity/EntityType.php b/core/lib/Drupal/Core/Entity/EntityType.php index 93f6062..1bac3d0 100644 --- a/core/lib/Drupal/Core/Entity/EntityType.php +++ b/core/lib/Drupal/Core/Entity/EntityType.php @@ -91,7 +91,7 @@ class EntityType implements EntityTypeInterface { * * @var bool (optional) */ - protected $fieldable; + protected $extendable; /** * Link templates using the URI template syntax. @@ -438,8 +438,8 @@ public function getPermissionGranularity() { /** * {@inheritdoc} */ - public function isFieldable() { - return isset($this->fieldable) ? $this->fieldable : FALSE; + public function isExtendable() { + return isset($this->extendable) ? $this->extendable : FALSE; } /** diff --git a/core/lib/Drupal/Core/Entity/EntityTypeInterface.php b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php index 5934322..3bf3d52 100644 --- a/core/lib/Drupal/Core/Entity/EntityTypeInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityTypeInterface.php @@ -380,7 +380,7 @@ public function getPermissionGranularity(); * @return bool * Returns TRUE if the entity type can has fields, otherwise FALSE. */ - public function isFieldable(); + public function isExtendable(); /** * Returns link templates using the URI template syntax. diff --git a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php b/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php index 31b1613..cd5e283 100644 --- a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php +++ b/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php @@ -455,7 +455,7 @@ protected function postLoad(array &$queried_entities) { $queried_entities = $this->mapFromStorageRecords($queried_entities); // Attach field values. - if ($this->entityType->isFieldable()) { + if ($this->entityType->isExtendable()) { $this->loadFieldItems($queried_entities); } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php index 6762331..3fff757 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php @@ -35,7 +35,7 @@ * "delete-form" = "aggregator.feed_delete", * }, * base_table = "aggregator_feed", - * fieldable = TRUE, + * extendable = TRUE, * entity_keys = { * "id" = "fid", * "label" = "title", diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php index 524e68f..5e92b60 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php @@ -24,7 +24,7 @@ * "view_builder" = "Drupal\aggregator\ItemViewBuilder" * }, * base_table = "aggregator_item", - * fieldable = TRUE, + * extendable = TRUE, * entity_keys = { * "id" = "iid", * "label" = "title", diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php index ea20a79..3bc8782 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php @@ -41,7 +41,7 @@ * "edit-form" = "custom_block.edit", * "admin-form" = "custom_block.type_edit" * }, - * fieldable = TRUE, + * extendable = TRUE, * translatable = TRUE, * entity_keys = { * "id" = "id", diff --git a/core/modules/block/lib/Drupal/block/Entity/Block.php b/core/modules/block/lib/Drupal/block/Entity/Block.php index 94fe675..12fb180 100644 --- a/core/modules/block/lib/Drupal/block/Entity/Block.php +++ b/core/modules/block/lib/Drupal/block/Entity/Block.php @@ -31,7 +31,7 @@ * } * }, * admin_permission = "administer blocks", - * fieldable = FALSE, + * extendable = FALSE, * entity_keys = { * "id" = "id", * "label" = "label" diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 07b177e..c7b1ab7 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -956,7 +956,7 @@ function comment_entity_predelete(EntityInterface $entity) { // 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()) diff --git a/core/modules/comment/comment.views.inc b/core/modules/comment/comment.views.inc index 6429f28..e14731e 100644 --- a/core/modules/comment/comment.views.inc +++ b/core/modules/comment/comment.views.inc @@ -353,7 +353,7 @@ function comment_views_data() { // Provide a relationship for each entity type except comment. foreach ($entities_types as $type => $entity_type) { - if ($type == 'comment' || !$entity_type->isFieldable() || !$entity_type->getBaseTable()) { + if ($type == 'comment' || !$entity_type->isExtendable() || !$entity_type->getBaseTable()) { continue; } if ($fields = \Drupal::service('comment.manager')->getFields($type)) { @@ -432,7 +432,7 @@ function comment_views_data() { // Provide a relationship for each entity type except comment. foreach ($entities_types as $type => $entity_type) { - if ($type == 'comment' || !$entity_type->isFieldable() || !$entity_type->getBaseTable()) { + if ($type == 'comment' || !$entity_type->isExtendable() || !$entity_type->getBaseTable()) { continue; } // This relationship does not use the 'field id' column, if the entity has @@ -604,7 +604,7 @@ function comment_views_data_alter(&$data) { // Provide a integration for each entity type except comment. foreach (\Drupal::entityManager()->getDefinitions() as $entity_type_id => $entity_type) { - if ($entity_type_id == 'comment' || !$entity_type->isFieldable() || !$entity_type->getBaseTable()) { + if ($entity_type_id == 'comment' || !$entity_type->isExtendable() || !$entity_type->getBaseTable()) { continue; } $fields = \Drupal::service('comment.manager')->getFields($entity_type_id); diff --git a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php index 6fd4552..ec4f3fb 100644 --- a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php +++ b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php @@ -36,7 +36,7 @@ * }, * base_table = "comment", * uri_callback = "comment_uri", - * fieldable = TRUE, + * extendable = TRUE, * translatable = TRUE, * entity_keys = { * "id" = "cid", diff --git a/core/modules/config_translation/config_translation.api.php b/core/modules/config_translation/config_translation.api.php index a7db185..a840a8f 100644 --- a/core/modules/config_translation/config_translation.api.php +++ b/core/modules/config_translation/config_translation.api.php @@ -38,7 +38,7 @@ function hook_config_translation_info(&$info) { // If field UI is not enabled, the base routes of the type // "field_ui.instance_edit_$entity_type" are not defined. if (\Drupal::moduleHandler()->moduleExists('field_ui')) { - // Add fields entity mappers to all fieldable entity types defined. + // Add fields entity mappers to all extendable entity types defined. foreach ($entity_manager->getDefinitions() as $entity_type_id => $entity_type) { $base_route = NULL; try { @@ -48,8 +48,8 @@ function hook_config_translation_info(&$info) { // Ignore non-existent routes. } - // Make sure entity type is fieldable and has a base route. - if ($entity_type->isFieldable() && !empty($base_route)) { + // Make sure entity type is extendable and has a base route. + if ($entity_type->isExtendable() && !empty($base_route)) { $info[$entity_type_id . '_fields'] = array( 'base_route_name' => 'field_ui.instance_edit_' . $entity_type_id, 'entity_type' => 'field_instance_config', diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module index e6f8081..8cbf17c 100644 --- a/core/modules/config_translation/config_translation.module +++ b/core/modules/config_translation/config_translation.module @@ -107,7 +107,7 @@ function config_translation_config_translation_info(&$info) { // If field UI is not enabled, the base routes of the type // "field_ui.instance_edit_$entity_type" are not defined. if (\Drupal::moduleHandler()->moduleExists('field_ui')) { - // Add fields entity mappers to all fieldable entity types defined. + // Add fields entity mappers to all extendable entity types defined. foreach ($entity_manager->getDefinitions() as $entity_type_id => $entity_type) { $base_route = NULL; try { @@ -117,8 +117,8 @@ function config_translation_config_translation_info(&$info) { // Ignore non-existent routes. } - // Make sure entity type is fieldable and has a base route. - if ($entity_type->isFieldable() && !empty($base_route)) { + // Make sure entity type is extendable and has a base route. + if ($entity_type->isExtendable() && !empty($base_route)) { $info[$entity_type_id . '_fields'] = array( 'base_route_name' => 'field_ui.instance_edit_' . $entity_type_id, 'entity_type' => 'field_instance_config', diff --git a/core/modules/contact/lib/Drupal/contact/Entity/Message.php b/core/modules/contact/lib/Drupal/contact/Entity/Message.php index a3a62cb..04381f7 100644 --- a/core/modules/contact/lib/Drupal/contact/Entity/Message.php +++ b/core/modules/contact/lib/Drupal/contact/Entity/Message.php @@ -29,7 +29,7 @@ * "bundle" = "category" * }, * bundle_entity_type = "contact_category", - * fieldable = TRUE, + * extendable = TRUE, * links = { * "admin-form" = "contact.category_edit" * } diff --git a/core/modules/content_translation/content_translation.admin.inc b/core/modules/content_translation/content_translation.admin.inc index 8ea5d1c..ebade10 100644 --- a/core/modules/content_translation/content_translation.admin.inc +++ b/core/modules/content_translation/content_translation.admin.inc @@ -86,7 +86,7 @@ function _content_translation_form_language_content_settings_form_alter(array &$ // Only show the checkbox to enable translation if the bundles in the // entity might have fields and if there are fields to translate. - if ($entity_type->isFieldable()) { + if ($entity_type->isExtendable()) { $fields = $entity_manager->getFieldDefinitions($entity_type_id, $bundle); if ($fields) { $form['settings'][$entity_type_id][$bundle]['translatable'] = array( diff --git a/core/modules/entity/lib/Drupal/entity/Controller/EntityDisplayModeController.php b/core/modules/entity/lib/Drupal/entity/Controller/EntityDisplayModeController.php index f0db942..71a0b13 100644 --- a/core/modules/entity/lib/Drupal/entity/Controller/EntityDisplayModeController.php +++ b/core/modules/entity/lib/Drupal/entity/Controller/EntityDisplayModeController.php @@ -23,7 +23,7 @@ class EntityDisplayModeController extends ControllerBase { public function viewModeTypeSelection() { $entity_types = array(); foreach ($this->entityManager()->getDefinitions() as $entity_type_id => $entity_type) { - if ($entity_type->isFieldable() && $entity_type->hasViewBuilderClass()) { + if ($entity_type->isExtendable() && $entity_type->hasViewBuilderClass()) { $entity_types[$entity_type_id] = array( 'title' => $entity_type->getLabel(), 'link_path' => 'admin/structure/display-modes/view/add/' . $entity_type_id, @@ -46,7 +46,7 @@ public function viewModeTypeSelection() { public function formModeTypeSelection() { $entity_types = array(); foreach ($this->entityManager()->getDefinitions() as $entity_type_id => $entity_type) { - if ($entity_type->isFieldable() && $entity_type->hasFormClasses()) { + if ($entity_type->isExtendable() && $entity_type->hasFormClasses()) { $entity_types[$entity_type_id] = array( 'title' => $entity_type->getLabel(), 'link_path' => 'admin/structure/display-modes/form/add/' . $entity_type_id, diff --git a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListBuilder.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListBuilder.php index 67f4a2d..c994414 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListBuilder.php +++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayModeListBuilder.php @@ -93,7 +93,7 @@ public function render() { } // Filter entities - if ($this->entityTypes[$entity_type]->isFieldable() && !$this->isValidEntity($entity_type)) { + if ($this->entityTypes[$entity_type]->isExtendable() && !$this->isValidEntity($entity_type)) { continue; } diff --git a/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php b/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php index 49be44f..7a287b4 100644 --- a/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php +++ b/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php @@ -48,7 +48,7 @@ public function validate(array $form, array &$form_state) { */ protected function prepareEntity() { $definition = $this->entityManager->getDefinition($this->targetEntityTypeId); - if (!$definition->isFieldable() || !$definition->hasViewBuilderClass()) { + if (!$definition->isExtendable() || !$definition->hasViewBuilderClass()) { throw new NotFoundHttpException(); } diff --git a/core/modules/entity/lib/Drupal/entity/Form/EntityFormModeAddForm.php b/core/modules/entity/lib/Drupal/entity/Form/EntityFormModeAddForm.php index 4cdece5..cee7dbb 100644 --- a/core/modules/entity/lib/Drupal/entity/Form/EntityFormModeAddForm.php +++ b/core/modules/entity/lib/Drupal/entity/Form/EntityFormModeAddForm.php @@ -19,7 +19,7 @@ class EntityFormModeAddForm extends EntityDisplayModeAddForm { */ protected function prepareEntity() { $definition = $this->entityManager->getDefinition($this->targetEntityTypeId); - if (!$definition->isFieldable() || !$definition->hasFormClasses()) { + if (!$definition->isExtendable() || !$definition->hasFormClasses()) { throw new NotFoundHttpException(); } diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceFormatterBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceFormatterBase.php index e0b6e0e..8d1bfcf 100644 --- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceFormatterBase.php +++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/Field/FieldFormatter/EntityReferenceFormatterBase.php @@ -55,7 +55,7 @@ public function prepareView(array $entities_items) { } } - // Iterate through the fieldable entities again to attach the loaded data. + // Iterate through the extendable entities again to attach the loaded data. foreach ($entities_items as $items) { $rekey = FALSE; foreach ($items as $item) { diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php index 92e9eb6..5d28eb6 100644 --- a/core/modules/field/field.api.php +++ b/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 @@ function hook_field_extra_fields() { } /** - * Alter "pseudo-field" components on fieldable entities. + * Alter "pseudo-field" components on extendable entities. * * @param $info * The associative array of 'pseudo-field' components. diff --git a/core/modules/field/field.attach.inc b/core/modules/field/field.attach.inc index a2f6c7c..507b029 100644 --- a/core/modules/field/field.attach.inc +++ b/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 diff --git a/core/modules/field/field.deprecated.inc b/core/modules/field/field.deprecated.inc index f939d0e..46f110e 100644 --- a/core/modules/field/field.deprecated.inc +++ b/core/modules/field/field.deprecated.inc @@ -314,7 +314,7 @@ function field_attach_form(EntityInterface $entity, &$form, &$form_state, $langc * * 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 diff --git a/core/modules/field/field.module b/core/modules/field/field.module index 0c173c2..bd29a19 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -28,7 +28,7 @@ * * The Field API allows custom data fields to be attached to Drupal entities and * takes care of storing, loading, editing, and rendering field data. Any entity - * type (node, user, etc.) can use the Field API to make itself "fieldable" and + * type (node, user, etc.) can use the Field API to make itself "extendable" and * thus allow fields to be attached to it. Other modules can provide a user * interface for managing custom fields via a web browser as well as a wide and * flexible variety of data type, form element, and display format capabilities. @@ -37,7 +37,7 @@ * the concept of a Bundle. A Field defines a particular type of data that can * be attached to entities. A Field Instance is a Field attached to a single * Bundle. A Bundle is a set of fields that are treated as a group by the Field - * Attach API and is related to a single fieldable entity type. + * Attach API and is related to a single extendable entity type. * * For example, suppose a site administrator wants Article nodes to have a * subtitle and photo. Using the Field API or Field UI module, the administrator @@ -61,8 +61,8 @@ * - @link field_attach Field Attach API @endlink: Connects entity types to the * Field API. Field Attach API functions load, store, generate Form API * structures, display, and perform a variety of other functions for field - * data connected to individual entities. Fieldable entity types like node and - * user use this API to make themselves fieldable. + * data connected to individual entities. Extendable entity types like node and + * user use this API to make themselves extendable. * * - @link field_info Field Info API @endlink: Exposes information about all * fields, instances, widgets, and related information defined by or with the @@ -83,7 +83,7 @@ function field_help($path, $arg) { case 'admin/help#field': $output = ''; $output .= '
' . t('The Field module allows custom data fields to be defined for entity types (entities include content items, comments, user accounts, and taxonomy terms). The Field module takes care of storing, loading, editing, and rendering field data. Most users will not interact with the Field module directly, but will instead use the Field UI module user interface. Module developers can use the Field API to make new entity types "fieldable" and thus allow fields to be attached to them. For more information, see the online handbook entry for Field module.', array('@field-ui-help' => url('admin/help/field_ui'), '@field' => 'http://drupal.org/documentation/modules/field')) . '
'; + $output .= '' . t('The Field module allows custom data fields to be defined for entity types (entities include content items, comments, user accounts, and taxonomy terms). The Field module takes care of storing, loading, editing, and rendering field data. Most users will not interact with the Field module directly, but will instead use the Field UI module user interface. Module developers can use the Field API to make new entity types "extendable" and thus allow fields to be attached to them. For more information, see the online handbook entry for Field module.', array('@field-ui-help' => url('admin/help/field_ui'), '@field' => 'http://drupal.org/documentation/modules/field')) . '
'; $output .= '