diff --git a/core/modules/block_content/block_content.module b/core/modules/block_content/block_content.module index 188eee7edb8cdc779f744e813887e3676cd77fac..7a917e515fe162a531a0b9517467731369cdfb0f 100644 --- a/core/modules/block_content/block_content.module +++ b/core/modules/block_content/block_content.module @@ -81,7 +81,7 @@ function block_content_add_body_field($block_type_id, $label = 'Body') { $field = FieldConfig::loadByName('block_content', $block_type_id, 'body'); if (empty($field_storage)) { $field_storage = entity_create('field_storage_config', array( - 'name' => 'body', + 'field_name' => 'body', 'entity_type' => 'block_content', 'type' => 'text_with_summary', )); diff --git a/core/modules/block_content/src/Tests/BlockContentFieldTest.php b/core/modules/block_content/src/Tests/BlockContentFieldTest.php index 7fd93d3e7c54bcb3421dcf4f6f67f766c9c5413b..bd967fe9b22717a85e6d040b5ce8a89173eeaaf4 100644 --- a/core/modules/block_content/src/Tests/BlockContentFieldTest.php +++ b/core/modules/block_content/src/Tests/BlockContentFieldTest.php @@ -55,7 +55,7 @@ public function testBlockFields() { // Create a field with settings to validate. $this->fieldStorage = entity_create('field_storage_config', array( - 'name' => drupal_strtolower($this->randomMachineName()), + 'field_name' => drupal_strtolower($this->randomMachineName()), 'entity_type' => 'block_content', 'type' => 'link', 'cardinality' => 2, diff --git a/core/modules/comment/src/CommentManager.php b/core/modules/comment/src/CommentManager.php index 251c34031eb5bcf18fb45b659c2abe61b5895ecf..f331f13bdda9b3d79d4991f1ce3368767434dea5 100644 --- a/core/modules/comment/src/CommentManager.php +++ b/core/modules/comment/src/CommentManager.php @@ -145,7 +145,7 @@ public function addDefaultField($entity_type, $bundle, $field_name = 'comment', // Add a default comment field for existing node comments. $field_storage = $this->entityManager->getStorage('field_storage_config')->create(array( 'entity_type' => $entity_type, - 'name' => $field_name, + 'field_name' => $field_name, 'type' => 'comment', 'translatable' => TRUE, 'settings' => array( @@ -221,7 +221,7 @@ public function addBodyField($comment_type_id) { $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body'); if (!$field_storage) { $field_storage = $this->entityManager->getStorage('field_storage_config')->create(array( - 'name' => 'comment_body', + 'field_name' => 'comment_body', 'type' => 'text_long', 'entity_type' => 'comment', )); diff --git a/core/modules/comment/src/Tests/CommentStringIdEntitiesTest.php b/core/modules/comment/src/Tests/CommentStringIdEntitiesTest.php index de2111231c9dc67932a05ed51e00040d94b51722..a81b949f3fce42b8ae793e7ab1b6deb985c4cde5 100644 --- a/core/modules/comment/src/Tests/CommentStringIdEntitiesTest.php +++ b/core/modules/comment/src/Tests/CommentStringIdEntitiesTest.php @@ -51,7 +51,7 @@ public function testCommentFieldNonStringId() { )); $bundle->save(); $field_storage = entity_create('field_storage_config', array( - 'name' => 'foo', + 'field_name' => 'foo', 'entity_type' => 'entity_test_string_id', 'settings' => array( 'comment_type' => 'entity_test_string_id', diff --git a/core/modules/comment/src/Tests/CommentValidationTest.php b/core/modules/comment/src/Tests/CommentValidationTest.php index 3dd16da374ba0ef7f0c0dd9a35b865dfffcb1604..61457f427e96442dc3d4441cd36e69af9172a91d 100644 --- a/core/modules/comment/src/Tests/CommentValidationTest.php +++ b/core/modules/comment/src/Tests/CommentValidationTest.php @@ -48,7 +48,7 @@ public function testValidation() { // Add comment field to content. $this->entityManager->getStorage('field_storage_config')->create(array( 'entity_type' => 'node', - 'name' => 'comment', + 'field_name' => 'comment', 'type' => 'comment', 'settings' => array( 'comment_type' => 'comment', diff --git a/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php b/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php index 521166a90fc3bb0d71f96b89a08688f2e38af005..e848cebd2d8a2db716c78ec80be2f3bd5a4c516e 100644 --- a/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php +++ b/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php @@ -46,9 +46,9 @@ function setUp() { // Make the comment body field translatable. The title is already // translatable by definition. - $field = FieldStorageConfig::loadByName('comment', 'comment_body'); - $field->translatable = TRUE; - $field->save(); + $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body'); + $field_storage->translatable = TRUE; + $field_storage->save(); // Set up comment titles. $this->comment_titles = array( diff --git a/core/modules/config/src/Tests/ConfigExportImportUITest.php b/core/modules/config/src/Tests/ConfigExportImportUITest.php index 13ddd20a090169b5fd8e406ea28f6d60d219000e..58da46a599ecc14ab736f9c1a215be751e5f8912 100644 --- a/core/modules/config/src/Tests/ConfigExportImportUITest.php +++ b/core/modules/config/src/Tests/ConfigExportImportUITest.php @@ -65,7 +65,7 @@ public function testExportImport() { // Create a field. $this->fieldName = drupal_strtolower($this->randomMachineName()); $this->fieldStorage = entity_create('field_storage_config', array( - 'name' => $this->fieldName, + 'field_name' => $this->fieldName, 'entity_type' => 'node', 'type' => 'text', )); @@ -104,7 +104,7 @@ public function testExportImport() { } $field_storages = entity_load_multiple('field_storage_config'); foreach ($field_storages as $field_storage) { - if ($field_storage->name == $this->fieldName) { + if ($field_storage->field_name == $this->fieldName) { $field_storage->delete(); } } diff --git a/core/modules/contact/src/Tests/Views/ContactFieldsTest.php b/core/modules/contact/src/Tests/Views/ContactFieldsTest.php index 9a35723d1ea240cc7bf9086a81b405f735905cd1..544152634e27d7f25dec32ed9a32ea3ea1ede375 100644 --- a/core/modules/contact/src/Tests/Views/ContactFieldsTest.php +++ b/core/modules/contact/src/Tests/Views/ContactFieldsTest.php @@ -34,7 +34,7 @@ protected function setUp() { parent::setUp(); $this->field_storage = entity_create('field_storage_config', array( - 'name' => strtolower($this->randomMachineName()), + 'field_name' => strtolower($this->randomMachineName()), 'entity_type' => 'contact_message', 'type' => 'text' )); diff --git a/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php b/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php index 81c0ce051b86dc36ac803ddb9b77c6b16275a650..7aacd04e5649583dce8c6bdb576f89bbbdfe4194 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationContextualLinksTest.php @@ -80,7 +80,7 @@ protected function setUp() { // Add a translatable field to the content type. entity_create('field_storage_config', array( - 'name' => 'field_test_text', + 'field_name' => 'field_test_text', 'entity_type' => 'node', 'type' => 'text', 'cardinality' => 1, diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php index 6fc1b0399666b67d1f0a08cb13aa23d6db9a6de3..2fc71c355514daa966869ef2119377a811e69fc2 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php @@ -228,7 +228,7 @@ function testFieldTranslatableSettingsUI() { // At least one field needs to be translatable to enable article for // translation. Create an extra field to be used for this purpose. $field_storage = array( - 'name' => 'article_text', + 'field_name' => 'article_text', 'entity_type' => 'node', 'type' => 'text', ); diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php index 09ae752c8719df622e7d61c3da89e4aa2749c57c..a1b3f1607e3cd50c90fefdb5db381adec2d10f31 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationSyncImageTest.php @@ -50,7 +50,7 @@ protected function setupTestFields() { $this->cardinality = 3; entity_create('field_storage_config', array( - 'name' => $this->fieldName, + 'field_name' => $this->fieldName, 'entity_type' => $this->entityTypeId, 'type' => 'image', 'cardinality' => $this->cardinality, diff --git a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php index 2b8cf971fcea105651d0d5e8e77106a49b633c6d..8bed5da88714c59d8cda2180ce23857dde05ccf5 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationTestBase.php @@ -179,7 +179,7 @@ protected function setupTestFields() { $this->fieldName = 'field_test_et_ui_test'; } entity_create('field_storage_config', array( - 'name' => $this->fieldName, + 'field_name' => $this->fieldName, 'type' => 'string', 'entity_type' => $this->entityTypeId, 'cardinality' => 1, diff --git a/core/modules/datetime/src/Tests/DateTimeFieldTest.php b/core/modules/datetime/src/Tests/DateTimeFieldTest.php index 7b90d6358d8bdc4e5b3fd2b7e0e829e365707efb..0656e7bd26df0e83130f113197423569beffa878 100644 --- a/core/modules/datetime/src/Tests/DateTimeFieldTest.php +++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php @@ -52,8 +52,9 @@ protected function setUp() { $this->drupalLogin($web_user); // Create a field with settings to validate. + $field_name = drupal_strtolower($this->randomMachineName()); $this->fieldStorage = entity_create('field_storage_config', array( - 'name' => drupal_strtolower($this->randomMachineName()), + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'datetime', 'settings' => array('datetime_type' => 'date'), @@ -67,7 +68,7 @@ protected function setUp() { $this->field->save(); entity_get_form_display($this->field->entity_type, $this->field->bundle, 'default') - ->setComponent($this->fieldStorage->name, array( + ->setComponent($field_name, array( 'type' => 'datetime_default', )) ->save(); @@ -78,7 +79,7 @@ protected function setUp() { 'settings' => array('format_type' => 'medium'), ); entity_get_display($this->field->entity_type, $this->field->bundle, 'full') - ->setComponent($this->fieldStorage->name, $this->display_options) + ->setComponent($field_name, $this->display_options) ->save(); } @@ -86,7 +87,7 @@ protected function setUp() { * Tests date field functionality. */ function testDateField() { - $field_name = $this->fieldStorage->name; + $field_name = $this->fieldStorage->field_name; // Display creation form. $this->drupalGet('entity_test/add'); @@ -151,7 +152,7 @@ function testDateField() { * Tests date and time field. */ function testDatetimeField() { - $field_name = $this->fieldStorage->name; + $field_name = $this->fieldStorage->getName(); // Change the field to a datetime field. $this->fieldStorage->settings['datetime_type'] = 'datetime'; $this->fieldStorage->save(); @@ -216,7 +217,7 @@ function testDatetimeField() { * Tests Date List Widget functionality. */ function testDatelistWidget() { - $field_name = $this->fieldStorage->name; + $field_name = $this->fieldStorage->getName(); // Change the field to a datetime field. $this->fieldStorage->settings['datetime_type'] = 'datetime'; $this->fieldStorage->save(); @@ -282,8 +283,9 @@ function testDefaultValue() { $this->drupalCreateContentType(array('type' => 'date_content')); // Create a field storage with settings to validate. + $field_name = drupal_strtolower($this->randomMachineName()); $field_storage = entity_create('field_storage_config', array( - 'name' => drupal_strtolower($this->randomMachineName()), + 'field_name' => $field_name, 'entity_type' => 'node', 'type' => 'datetime', 'settings' => array('datetime_type' => 'date'), @@ -300,15 +302,15 @@ function testDefaultValue() { $field_edit = array( 'default_value_input[default_date_type]' => 'now', ); - $this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name, $field_edit, t('Save settings')); + $this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name, $field_edit, t('Save settings')); // Check that default value is selected in default value form. - $this->drupalGet('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name); + $this->drupalGet('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name); $this->assertOptionSelected('edit-default-value-input-default-date-type', 'now', 'The default value is selected in instance settings page'); $this->assertFieldByName('default_value_input[default_date]', '', 'The relative default value is empty in instance settings page'); // Check if default_date has been stored successfully. - $config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_storage->name)->get(); + $config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_name)->get(); $this->assertEqual($config_entity['default_value'][0], array('default_date_type' => 'now', 'default_date' => 'now'), 'Default value has been stored successfully'); // Clear field cache in order to avoid stale cache values. @@ -317,14 +319,14 @@ function testDefaultValue() { // Create a new node to check that datetime field default value is today. $new_node = entity_create('node', array('type' => 'date_content')); $expected_date = new DrupalDateTime('now', DATETIME_STORAGE_TIMEZONE); - $this->assertEqual($new_node->get($field_storage->name)->offsetGet(0)->value, $expected_date->format(DATETIME_DATE_STORAGE_FORMAT)); + $this->assertEqual($new_node->get($field_name)->offsetGet(0)->value, $expected_date->format(DATETIME_DATE_STORAGE_FORMAT)); // Set an invalid relative default_value to test validation. $field_edit = array( 'default_value_input[default_date_type]' => 'relative', 'default_value_input[default_date]' => 'invalid date', ); - $this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name, $field_edit, t('Save settings')); + $this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name, $field_edit, t('Save settings')); $this->assertText('The relative date value entered is invalid.'); @@ -333,15 +335,15 @@ function testDefaultValue() { 'default_value_input[default_date_type]' => 'relative', 'default_value_input[default_date]' => '+90 days', ); - $this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name, $field_edit, t('Save settings')); + $this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name, $field_edit, t('Save settings')); // Check that default value is selected in default value form. - $this->drupalGet('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name); + $this->drupalGet('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name); $this->assertOptionSelected('edit-default-value-input-default-date-type', 'relative', 'The default value is selected in instance settings page'); $this->assertFieldByName('default_value_input[default_date]', '+90 days', 'The relative default value is displayed in instance settings page'); // Check if default_date has been stored successfully. - $config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_storage->name)->get(); + $config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_name)->get(); $this->assertEqual($config_entity['default_value'][0], array('default_date_type' => 'relative', 'default_date' => '+90 days'), 'Default value has been stored successfully'); // Clear field cache in order to avoid stale cache values. @@ -350,21 +352,21 @@ function testDefaultValue() { // Create a new node to check that datetime field default value is +90 days. $new_node = entity_create('node', array('type' => 'date_content')); $expected_date = new DrupalDateTime('+90 days', DATETIME_STORAGE_TIMEZONE); - $this->assertEqual($new_node->get($field_storage->name)->offsetGet(0)->value, $expected_date->format(DATETIME_DATE_STORAGE_FORMAT)); + $this->assertEqual($new_node->get($field_name)->offsetGet(0)->value, $expected_date->format(DATETIME_DATE_STORAGE_FORMAT)); // Remove default value. $field_edit = array( 'default_value_input[default_date_type]' => '', ); - $this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name, $field_edit, t('Save settings')); + $this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name, $field_edit, t('Save settings')); // Check that default value is selected in default value form. - $this->drupalGet('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name); + $this->drupalGet('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name); $this->assertOptionSelected('edit-default-value-input-default-date-type', '', 'The default value is selected in instance settings page'); $this->assertFieldByName('default_value_input[default_date]', '', 'The relative default value is empty in instance settings page'); // Check if default_date has been stored successfully. - $config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_storage->name)->get(); + $config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_name)->get(); $this->assertTrue(empty($config_entity['default_value']), 'Empty default value has been stored successfully'); // Clear field cache in order to avoid stale cache values. @@ -372,7 +374,7 @@ function testDefaultValue() { // Create a new node to check that datetime field default value is not set. $new_node = entity_create('node', array('type' => 'date_content')); - $this->assertNull($new_node->get($field_storage->name)->offsetGet(0)->value, 'Default value is not set'); + $this->assertNull($new_node->get($field_name)->offsetGet(0)->value, 'Default value is not set'); } /** @@ -383,7 +385,7 @@ function testInvalidField() { // Change the field to a datetime field. $this->fieldStorage->settings['datetime_type'] = 'datetime'; $this->fieldStorage->save(); - $field_name = $this->fieldStorage->name; + $field_name = $this->fieldStorage->getName(); // Display creation form. $this->drupalGet('entity_test/add'); diff --git a/core/modules/datetime/src/Tests/DateTimeItemTest.php b/core/modules/datetime/src/Tests/DateTimeItemTest.php index 9dd78979c04bd39d4842c29d15b2046779f97d53..d83d2a2ad1d4a7965d4aaeeecca0e329c2525fa1 100644 --- a/core/modules/datetime/src/Tests/DateTimeItemTest.php +++ b/core/modules/datetime/src/Tests/DateTimeItemTest.php @@ -30,7 +30,7 @@ protected function setUp() { // Create a field with settings to validate. $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_datetime', + 'field_name' => 'field_datetime', 'type' => 'datetime', 'entity_type' => 'entity_test', 'settings' => array('datetime_type' => 'date'), diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module index ed133704715451f5b57980be2f8585551bc06018..33516d77659a3046bef3c077c82df12d56143272 100644 --- a/core/modules/entity_reference/entity_reference.module +++ b/core/modules/entity_reference/entity_reference.module @@ -205,24 +205,19 @@ function entity_reference_query_entity_reference_alter(AlterableInterface $query */ function entity_reference_create_field($entity_type, $bundle, $field_name, $field_label, $target_entity_type, $selection_handler = 'default', $selection_handler_settings = array(), $cardinality = 1) { // Look for or add the specified field to the requested entity bundle. - $field_storage = FieldStorageConfig::loadByName($entity_type, $field_name); - $field = FieldConfig::loadByName($entity_type, $bundle, $field_name); - - if (empty($field_storage)) { - $field_storage = array( - 'name' => $field_name, + if (!FieldStorageConfig::loadByName($entity_type, $field_name)) { + entity_create('field_storage_config', array( + 'field_name' => $field_name, 'type' => 'entity_reference', 'entity_type' => $entity_type, 'cardinality' => $cardinality, 'settings' => array( 'target_type' => $target_entity_type, ), - ); - entity_create('field_storage_config', $field_storage)->save(); + ))->save(); } - - if (empty($field)) { - $field = array( + if (!FieldConfig::loadByName($entity_type, $bundle, $field_name)) { + entity_create('field_config', array( 'field_name' => $field_name, 'entity_type' => $entity_type, 'bundle' => $bundle, @@ -231,8 +226,7 @@ function entity_reference_create_field($entity_type, $bundle, $field_name, $fiel 'handler' => $selection_handler, 'handler_settings' => $selection_handler_settings, ), - ); - entity_create('field_config', $field)->save(); + ))->save(); } } diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceAutoCreateTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceAutoCreateTest.php index 3b1cc5efa91900d215d9cb25107f316a0dbd2c4e..7dc81b895fb6e632d60ed9edfdb75b49dc01fec6 100644 --- a/core/modules/entity_reference/src/Tests/EntityReferenceAutoCreateTest.php +++ b/core/modules/entity_reference/src/Tests/EntityReferenceAutoCreateTest.php @@ -30,7 +30,7 @@ protected function setUp() { $this->referenced_type = $referenced->type; entity_create('field_storage_config', array( - 'name' => 'test_field', + 'field_name' => 'test_field', 'entity_type' => 'node', 'translatable' => FALSE, 'entity_types' => array(), diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php index c4fd5b65ad46f042a74e9ecc27916ddab79f9620..5c818550bb764722d2b97c2d39d1ba75b5c93746 100644 --- a/core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php +++ b/core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php @@ -42,15 +42,16 @@ function testEntityReferenceDefaultValue() { // Create a node to be referenced. $referenced_node = $this->drupalCreateNode(array('type' => 'referenced_content')); - $this->fieldStorage = entity_create('field_storage_config', array( - 'name' => drupal_strtolower($this->randomMachineName()), + $field_name = drupal_strtolower($this->randomMachineName()); + $field_storage = entity_create('field_storage_config', array( + 'field_name' => $field_name, 'entity_type' => 'node', 'type' => 'entity_reference', 'settings' => array('target_type' => 'node'), )); - $this->fieldStorage->save(); - $this->field = entity_create('field_config', array( - 'field_storage' => $this->fieldStorage, + $field_storage->save(); + $field = entity_create('field_config', array( + 'field_storage' => $field_storage, 'bundle' => 'reference_content', 'settings' => array( 'handler' => 'default', @@ -60,20 +61,20 @@ function testEntityReferenceDefaultValue() { ), ), )); - $this->field->save(); + $field->save(); // Set created node as default_value. $field_edit = array( - 'default_value_input[' . $this->fieldStorage->name . '][0][target_id]' => $referenced_node->getTitle() . ' (' .$referenced_node->id() . ')', + 'default_value_input[' . $field_name . '][0][target_id]' => $referenced_node->getTitle() . ' (' .$referenced_node->id() . ')', ); - $this->drupalPostForm('admin/structure/types/manage/reference_content/fields/node.reference_content.' . $this->fieldStorage->name, $field_edit, t('Save settings')); + $this->drupalPostForm('admin/structure/types/manage/reference_content/fields/node.reference_content.' . $field_name, $field_edit, t('Save settings')); // Check that default value is selected in default value form. - $this->drupalGet('admin/structure/types/manage/reference_content/fields/node.reference_content.' . $this->fieldStorage->name); - $this->assertRaw('name="default_value_input[' . $this->fieldStorage->name . '][0][target_id]" value="' . $referenced_node->getTitle() .' (' .$referenced_node->id() . ')', 'The default value is selected in instance settings page'); + $this->drupalGet('admin/structure/types/manage/reference_content/fields/node.reference_content.' . $field_name); + $this->assertRaw('name="default_value_input[' . $field_name . '][0][target_id]" value="' . $referenced_node->getTitle() .' (' .$referenced_node->id() . ')', 'The default value is selected in instance settings page'); // Check if the ID has been converted to UUID in config entity. - $config_entity = $this->container->get('config.factory')->get('field.field.node.reference_content.' . $this->fieldStorage->name)->get(); + $config_entity = $this->container->get('config.factory')->get('field.field.node.reference_content.' . $field_name)->get(); $this->assertTrue(isset($config_entity['default_value'][0]['target_uuid']), 'Default value contains target_uuid property'); $this->assertEqual($config_entity['default_value'][0]['target_uuid'], $referenced_node->uuid(), 'Content uuid and config entity uuid are the same'); @@ -82,7 +83,7 @@ function testEntityReferenceDefaultValue() { // Create a new node to check that UUID has been converted to numeric ID. $new_node = entity_create('node', array('type' => 'reference_content')); - $this->assertEqual($new_node->get($this->fieldStorage->name)->offsetGet(0)->target_id, $referenced_node->id()); + $this->assertEqual($new_node->get($field_name)->offsetGet(0)->target_id, $referenced_node->id()); } } diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceFormatterTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceFormatterTest.php index 84734f10a694cc9f709e59e84ca27be4bc53db33..6f790aa470d5713f6566c71b26efd35148eb7238 100644 --- a/core/modules/entity_reference/src/Tests/EntityReferenceFormatterTest.php +++ b/core/modules/entity_reference/src/Tests/EntityReferenceFormatterTest.php @@ -61,7 +61,7 @@ protected function setUp() { // Set up a field, so that the entity that'll be referenced bubbles up a // cache tag when rendering it entirely. entity_create('field_storage_config', array( - 'name' => 'body', + 'field_name' => 'body', 'entity_type' => $this->entityType, 'type' => 'text', 'settings' => array(), diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php index 648786b51fa6589466ceaf16dfda08253648018b..a6edb35f52890ba9d915c5b9e04b1b3d6640e155 100644 --- a/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php +++ b/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php @@ -57,7 +57,7 @@ protected function assertReferenceable(FieldDefinitionInterface $field_definitio public function testNodeHandler() { // Create a field. $field_storage = entity_create('field_storage_config', array( - 'name' => 'test_field', + 'field_name' => 'test_field', 'entity_type' => 'entity_test', 'translatable' => FALSE, 'entity_types' => array(), @@ -200,7 +200,7 @@ public function testNodeHandler() { public function testUserHandler() { // Create a field. $field_storage = entity_create('field_storage_config', array( - 'name' => 'test_field', + 'field_name' => 'test_field', 'entity_type' => 'entity_test', 'translatable' => FALSE, 'settings' => array( @@ -344,7 +344,7 @@ public function testUserHandler() { public function testCommentHandler() { // Create a field. $field_storage = entity_create('field_storage_config', array( - 'name' => 'test_field', + 'field_name' => 'test_field', 'entity_type' => 'entity_test', 'translatable' => FALSE, 'entity_types' => array(), diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceSelectionSortTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceSelectionSortTest.php index 8b66ec64b8ba04734628a43f732c0396c6a9308f..c0b3b35f6d58bb2791af8809d0327288d071173c 100644 --- a/core/modules/entity_reference/src/Tests/EntityReferenceSelectionSortTest.php +++ b/core/modules/entity_reference/src/Tests/EntityReferenceSelectionSortTest.php @@ -32,7 +32,7 @@ protected function setUp() { public function testSort() { // Add text field to entity, to sort by. entity_create('field_storage_config', array( - 'name' => 'field_text', + 'field_name' => 'field_text', 'entity_type' => 'node', 'type' => 'text', 'entity_types' => array('node'), @@ -50,7 +50,7 @@ public function testSort() { // Create a field. $field_storage = entity_create('field_storage_config', array( - 'name' => 'test_field', + 'field_name' => 'test_field', 'entity_type' => 'entity_test', 'translatable' => FALSE, 'settings' => array( diff --git a/core/modules/entity_reference/src/Tests/Views/EntityReferenceRelationshipTest.php b/core/modules/entity_reference/src/Tests/Views/EntityReferenceRelationshipTest.php index d61ee3731547087e7d8e91f6400a2922d94eea98..966fb54bbece3fa2df91636754044f169246dd46 100644 --- a/core/modules/entity_reference/src/Tests/Views/EntityReferenceRelationshipTest.php +++ b/core/modules/entity_reference/src/Tests/Views/EntityReferenceRelationshipTest.php @@ -55,12 +55,12 @@ protected function setUp() { ViewTestData::createTestViews(get_class($this), array('entity_reference_test_views')); $field_storage = FieldStorageConfig::create(array( + 'entity_type' => 'entity_test', + 'field_name' => 'field_test', + 'type' => 'entity_reference', 'settings' => array( 'target_type' => 'entity_test', ), - 'entity_type' => 'entity_test', - 'name' => 'field_test', - 'type' => 'entity_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, )); $field_storage->save(); diff --git a/core/modules/entity_reference/src/Tests/Views/SelectionTest.php b/core/modules/entity_reference/src/Tests/Views/SelectionTest.php index f49b92af5f6c813c566c41c108dbe34a9eee43a0..e71737c1c604199ce918efcda8260c3cdf7c09ba 100644 --- a/core/modules/entity_reference/src/Tests/Views/SelectionTest.php +++ b/core/modules/entity_reference/src/Tests/Views/SelectionTest.php @@ -35,7 +35,7 @@ public function testSelectionHandler() { // Create a field. $field_storage = entity_create('field_storage_config', array( - 'name' => 'test_field', + 'field_name' => 'test_field', 'entity_type' => 'entity_test', 'translatable' => FALSE, 'settings' => array( diff --git a/core/modules/field/config/schema/field.schema.yml b/core/modules/field/config/schema/field.schema.yml index f91e6ae2bb02339d69e531d341a964112ebf419b..862f40aca859e38b570abd423424011ef1c104d3 100644 --- a/core/modules/field/config/schema/field.schema.yml +++ b/core/modules/field/config/schema/field.schema.yml @@ -15,9 +15,9 @@ field.storage.*.*: id: type: string label: 'ID' - name: + field_name: type: string - label: 'Name' + label: 'Field name' entity_type: type: string label: 'Entity type' diff --git a/core/modules/field/field.module b/core/modules/field/field.module index 118e504dce9fdb5decbd5f8688328e4c04b4c923..980ec21bccfa3e10fbf16dfaa84860b3ba101586 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -124,15 +124,15 @@ function field_system_info_alter(&$info, Extension $file, $type) { // It is not safe to call entity_load_multiple_by_properties() during // maintenance mode. if ($type == 'module' && !defined('MAINTENANCE_MODE')) { - $fields = entity_load_multiple_by_properties('field_storage_config', array('module' => $file->getName(), 'include_deleted' => TRUE)); - if ($fields) { + $field_storages = entity_load_multiple_by_properties('field_storage_config', array('module' => $file->getName(), 'include_deleted' => TRUE)); + if ($field_storages) { $info['required'] = TRUE; // Provide an explanation message (only mention pending deletions if there // remains no actual, non-deleted fields) $non_deleted = FALSE; - foreach ($fields as $field) { - if (empty($field->deleted)) { + foreach ($field_storages as $field_storage) { + if (empty($field_storage->deleted)) { $non_deleted = TRUE; break; } diff --git a/core/modules/field/field.views.inc b/core/modules/field/field.views.inc index 33222ccf122410a06c26340d2a9bb29c4bf0a1c9..cc263668baa108da3aa5af7417d9bf3e366e74a8 100644 --- a/core/modules/field/field.views.inc +++ b/core/modules/field/field.views.inc @@ -21,13 +21,13 @@ function field_views_data() { $data = array(); $module_handler = \Drupal::moduleHandler(); - foreach (\Drupal::entityManager()->getStorage('field_storage_config')->loadMultiple() as $field) { - if (_field_views_get_entity_type_storage($field)) { - $result = (array) $module_handler->invoke($field->module, 'field_views_data', array($field)); + foreach (\Drupal::entityManager()->getStorage('field_storage_config')->loadMultiple() as $field_storage) { + if (_field_views_get_entity_type_storage($field_storage)) { + $result = (array) $module_handler->invoke($field_storage->module, 'field_views_data', array($field_storage)); if (empty($result)) { - $result = field_views_field_default_views_data($field); + $result = field_views_field_default_views_data($field_storage); } - $module_handler->alter('field_views_data', $result, $field); + $module_handler->alter('field_views_data', $result, $field_storage); if (is_array($result)) { $data = NestedArray::mergeDeep($result, $data); @@ -47,11 +47,11 @@ function field_views_data() { * in field_views_data. */ function field_views_data_alter(&$data) { - foreach (\Drupal::entityManager()->getStorage('field_storage_config')->loadMultiple() as $field) { - if (_field_views_get_entity_type_storage($field)) { - $function = $field->module . '_field_views_data_views_data_alter'; + foreach (\Drupal::entityManager()->getStorage('field_storage_config')->loadMultiple() as $field_storage) { + if (_field_views_get_entity_type_storage($field_storage)) { + $function = $field_storage->module . '_field_views_data_views_data_alter'; if (function_exists($function)) { - $function($data, $field); + $function($data, $field_storage); } } } diff --git a/core/modules/field/src/Entity/FieldStorageConfig.php b/core/modules/field/src/Entity/FieldStorageConfig.php index f84632dca32771344410b7a2d3a0ec733bea5a03..7f9d5d93a21008105eefead4a5e1b9736aece2f2 100644 --- a/core/modules/field/src/Entity/FieldStorageConfig.php +++ b/core/modules/field/src/Entity/FieldStorageConfig.php @@ -62,7 +62,7 @@ class FieldStorageConfig extends ConfigEntityBase implements FieldStorageConfigI * * @var string */ - public $name; + public $field_name; /** * The name of the entity type the field can be attached to. @@ -201,17 +201,17 @@ class FieldStorageConfig extends ConfigEntityBase implements FieldStorageConfigI */ public function __construct(array $values, $entity_type = 'field_storage_config') { // Check required properties. - if (empty($values['name'])) { - throw new FieldException('Attempt to create an unnamed field storage.'); + if (empty($values['field_name'])) { + throw new FieldException('Attempt to create a field storage without a field name.'); } - if (!preg_match('/^[_a-z]+[_a-z0-9]*$/', $values['name'])) { - throw new FieldException(String::format('Attempt to create a field storage @field_name with invalid characters. Only lowercase alphanumeric characters and underscores are allowed, and only lowercase letters and underscore are allowed as the first character', array('@field_name' => $values['name']))); + if (!preg_match('/^[_a-z]+[_a-z0-9]*$/', $values['field_name'])) { + throw new FieldException(String::format('Attempt to create a field storage @field_name with invalid characters. Only lowercase alphanumeric characters and underscores are allowed, and only lowercase letters and underscore are allowed as the first character', array('@field_name' => $values['field_name']))); } if (empty($values['type'])) { - throw new FieldException(String::format('Attempt to create a field storage @field_name with no type.', array('@field_name' => $values['name']))); + throw new FieldException(String::format('Attempt to create a field storage @field_name with no type.', array('@field_name' => $values['field_name']))); } if (empty($values['entity_type'])) { - throw new FieldException(String::format('Attempt to create a field storage @field_name with no entity_type.', array('@field_name' => $values['name']))); + throw new FieldException(String::format('Attempt to create a field storage @field_name with no entity_type.', array('@field_name' => $values['field_name']))); } parent::__construct($values, $entity_type); @@ -221,7 +221,7 @@ public function __construct(array $values, $entity_type = 'field_storage_config' * {@inheritdoc} */ public function id() { - return $this->entity_type . '.' . $this->name; + return $this->entity_type . '.' . $this->field_name; } /** @@ -264,19 +264,19 @@ protected function preSaveNew(EntityStorageInterface $storage) { // Field name cannot be longer than FieldStorageConfig::NAME_MAX_LENGTH characters. // We use Unicode::strlen() because the DB layer assumes that column widths // are given in characters rather than bytes. - if (Unicode::strlen($this->name) > static::NAME_MAX_LENGTH) { + if (Unicode::strlen($this->field_name) > static::NAME_MAX_LENGTH) { throw new FieldException(String::format( 'Attempt to create a field storage with an name longer than @max characters: %name', array( '@max' => static::NAME_MAX_LENGTH, - '%name' => $this->name, + '%name' => $this->field_name, ) )); } // Disallow reserved field names. $disallowed_field_names = array_keys($entity_manager->getBaseFieldDefinitions($this->entity_type)); - if (in_array($this->name, $disallowed_field_names)) { - throw new FieldException(String::format('Attempt to create field storage %name which is reserved by entity type %type.', array('%name' => $this->name, '%type' => $this->entity_type))); + if (in_array($this->field_name, $disallowed_field_names)) { + throw new FieldException(String::format('Attempt to create field storage %name which is reserved by entity type %type.', array('%name' => $this->field_name, '%type' => $this->entity_type))); } // Check that the field type is known. @@ -368,7 +368,7 @@ public static function preDelete(EntityStorageInterface $storage, array $field_s foreach ($field_storages as $field_storage) { if (!$field_storage->deleted) { foreach ($field_storage->getBundles() as $bundle) { - $field_ids[] = "{$field_storage->entity_type}.$bundle.{$field_storage->name}"; + $field_ids[] = "{$field_storage->entity_type}.$bundle.{$field_storage->field_name}"; } } } @@ -468,8 +468,8 @@ public function getColumns() { public function getBundles() { if (empty($this->deleted)) { $map = \Drupal::entityManager()->getFieldMap(); - if (isset($map[$this->entity_type][$this->name]['bundles'])) { - return $map[$this->entity_type][$this->name]['bundles']; + if (isset($map[$this->entity_type][$this->field_name]['bundles'])) { + return $map[$this->entity_type][$this->field_name]['bundles']; } } return array(); @@ -479,7 +479,7 @@ public function getBundles() { * {@inheritdoc} */ public function getName() { - return $this->name; + return $this->field_name; } /** diff --git a/core/modules/field/src/FieldConfigStorage.php b/core/modules/field/src/FieldConfigStorage.php index 08baae5827baf44ba8c81e85eb03c872afb484ff..89ea1818c3dd383b1601680c9b9ff7a6e1c870de 100644 --- a/core/modules/field/src/FieldConfigStorage.php +++ b/core/modules/field/src/FieldConfigStorage.php @@ -138,7 +138,7 @@ public function loadByProperties(array $conditions = array()) { // Collect matching fields. $matching_fields = array(); foreach ($fields as $field) { - // Some conditions are checked against the field. + // Some conditions are checked against the field storage. $field_storage = $field->getFieldStorageDefinition(); // Only keep the field if it matches all conditions. @@ -146,7 +146,7 @@ public function loadByProperties(array $conditions = array()) { // Extract the actual value against which the condition is checked. switch ($key) { case 'field_name': - $checked_value = $field_storage->name; + $checked_value = $field_storage->getName(); break; case 'field_id': diff --git a/core/modules/field/src/FieldStorageConfigStorage.php b/core/modules/field/src/FieldStorageConfigStorage.php index 63537316010c6225abd510744e840bdfe4f1e325..d865d851f3521fce858f56c15d674ce9cfd2e631 100644 --- a/core/modules/field/src/FieldStorageConfigStorage.php +++ b/core/modules/field/src/FieldStorageConfigStorage.php @@ -16,7 +16,6 @@ use Drupal\Core\Language\LanguageManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Config\StorageInterface; use Drupal\Core\Extension\ModuleHandler; use Drupal\Core\State\StateInterface; @@ -136,10 +135,6 @@ public function loadByProperties(array $conditions = array()) { foreach ($conditions as $key => $value) { // Extract the actual value against which the condition is checked. switch ($key) { - case 'field_name'; - $checked_value = $field->name; - break; - case 'uuid'; $checked_value = $field->uuid(); break; @@ -162,7 +157,6 @@ public function loadByProperties(array $conditions = array()) { } return $matches; - } /** diff --git a/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php b/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php index de665cb9930b0af894fefb16224241d06058e378..9d972d32d53e47fd84d1a8e70044de4c0b6f2430 100644 --- a/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php +++ b/core/modules/field/src/Tests/Boolean/BooleanFieldTest.php @@ -65,7 +65,7 @@ function testBooleanField() { // Create a field with settings to validate. $field_name = drupal_strtolower($this->randomMachineName()); $this->field_storage = FieldStorageConfig::create(array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'boolean', 'settings' => array( diff --git a/core/modules/field/src/Tests/Boolean/BooleanItemTest.php b/core/modules/field/src/Tests/Boolean/BooleanItemTest.php index 631edc8ab3a079a2cafb645307dd93f6c6988cb6..479fc204a53ffdd722f4327649c47138cf82e33a 100644 --- a/core/modules/field/src/Tests/Boolean/BooleanItemTest.php +++ b/core/modules/field/src/Tests/Boolean/BooleanItemTest.php @@ -26,7 +26,7 @@ protected function setUp() { // Create a boolean field and storage for validation. entity_create('field_storage_config', array( - 'name' => 'field_boolean', + 'field_name' => 'field_boolean', 'entity_type' => 'entity_test', 'type' => 'boolean', ))->save(); diff --git a/core/modules/field/src/Tests/BulkDeleteTest.php b/core/modules/field/src/Tests/BulkDeleteTest.php index 740db44c36fef16aabce1021233fe5b61a7a0545..4ae227b916b618d68c362a7fa96f2e266be75f5a 100644 --- a/core/modules/field/src/Tests/BulkDeleteTest.php +++ b/core/modules/field/src/Tests/BulkDeleteTest.php @@ -106,7 +106,7 @@ protected function setUp() { // Create two field storages. $field_storage = entity_create('field_storage_config', array( - 'name' => 'bf_1', + 'field_name' => 'bf_1', 'entity_type' => $this->entity_type, 'type' => 'test_field', 'cardinality' => 1 @@ -114,7 +114,7 @@ protected function setUp() { $field_storage->save(); $this->fieldStorages[] = $field_storage; $field_storage = entity_create('field_storage_config', array( - 'name' => 'bf_2', + 'field_name' => 'bf_2', 'entity_type' => $this->entity_type, 'type' => 'test_field', 'cardinality' => 4 @@ -157,7 +157,7 @@ protected function setUp() { function testDeleteField() { $bundle = reset($this->bundles); $field_storage = reset($this->fieldStorages); - $field_name = $field_storage->name; + $field_name = $field_storage->getName(); $factory = \Drupal::service('entity.query'); // There are 10 entities of this bundle. @@ -167,7 +167,7 @@ function testDeleteField() { $this->assertEqual(count($found), 10, 'Correct number of entities found before deleting'); // Delete the field. - $field = FieldConfig::loadByName($this->entity_type, $bundle, $field_storage->name); + $field = FieldConfig::loadByName($this->entity_type, $bundle, $field_name); $field->delete(); // The field still exists, deleted. @@ -186,7 +186,7 @@ function testDeleteField() { ->fields('t') ->execute(); foreach ($result as $row) { - $this->assertEqual($this->entities[$row->entity_id]->{$field_storage->name}->value, $row->$column); + $this->assertEqual($this->entities[$row->entity_id]->{$field_name}->value, $row->$column); } // There are 0 entities of this bundle with non-deleted data. @@ -217,9 +217,10 @@ function testPurgeField() { $bundle = reset($this->bundles); $field_storage = reset($this->fieldStorages); + $field_name = $field_storage->getName(); // Delete the field. - $field = FieldConfig::loadByName($this->entity_type, $bundle, $field_storage->name); + $field = FieldConfig::loadByName($this->entity_type, $bundle, $field_name); $field->delete(); // No field hooks were called. @@ -234,7 +235,7 @@ function testPurgeField() { // There are $count deleted entities left. $found = \Drupal::entityQuery('entity_test') ->condition('type', $bundle) - ->condition($field_storage->name . '.deleted', 1) + ->condition($field_name . '.deleted', 1) ->execute(); $this->assertEqual(count($found), $count, 'Correct number of entities found after purging 2'); } @@ -276,10 +277,11 @@ function testPurgeFieldStorage() { field_test_memorize(); $field_storage = reset($this->fieldStorages); + $field_name = $field_storage->getName(); // Delete the first field. $bundle = reset($this->bundles); - $field = FieldConfig::loadByName($this->entity_type, $bundle, $field_storage->name); + $field = FieldConfig::loadByName($this->entity_type, $bundle, $field_name); $field->delete(); // Assert that FieldItemInterface::delete() was not called yet. @@ -316,7 +318,7 @@ function testPurgeFieldStorage() { // Delete the second field. $bundle = next($this->bundles); - $field = FieldConfig::loadByName($this->entity_type, $bundle, $field_storage->name); + $field = FieldConfig::loadByName($this->entity_type, $bundle, $field_name); $field->delete(); // Assert that FieldItemInterface::delete() was not called yet. diff --git a/core/modules/field/src/Tests/DisplayApiTest.php b/core/modules/field/src/Tests/DisplayApiTest.php index f00798faa9a623631500c67c697e914610286542..4123ab31ee3112c83f7f473c97a88980b4d14c97 100644 --- a/core/modules/field/src/Tests/DisplayApiTest.php +++ b/core/modules/field/src/Tests/DisplayApiTest.php @@ -67,7 +67,7 @@ protected function setUp() { $this->cardinality = 4; $field_storage = array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'entity_test', 'type' => 'test_field', 'cardinality' => $this->cardinality, diff --git a/core/modules/field/src/Tests/Email/EmailFieldTest.php b/core/modules/field/src/Tests/Email/EmailFieldTest.php index b2417060c40cc82f463d49139cbf1084c5427f18..d8ff0516153f7f63c165c6d0e2c7b73126411073 100644 --- a/core/modules/field/src/Tests/Email/EmailFieldTest.php +++ b/core/modules/field/src/Tests/Email/EmailFieldTest.php @@ -55,7 +55,7 @@ function testEmailField() { // Create a field with settings to validate. $field_name = drupal_strtolower($this->randomMachineName()); $this->fieldStorage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'email', )); diff --git a/core/modules/field/src/Tests/Email/EmailItemTest.php b/core/modules/field/src/Tests/Email/EmailItemTest.php index f190ec5e95a94327fbbf78984a3c4e53eef1ec83..b6a148f30a824ef1ecc6aa0f9410a9726dbfb8db 100644 --- a/core/modules/field/src/Tests/Email/EmailItemTest.php +++ b/core/modules/field/src/Tests/Email/EmailItemTest.php @@ -23,7 +23,7 @@ protected function setUp() { // Create an email field storage and field for validation. entity_create('field_storage_config', array( - 'name' => 'field_email', + 'field_name' => 'field_email', 'entity_type' => 'entity_test', 'type' => 'email', ))->save(); diff --git a/core/modules/field/src/Tests/FieldAccessTest.php b/core/modules/field/src/Tests/FieldAccessTest.php index 2c36caba268f023daebc0a00f783ba42d774a32b..b4f0b5a813f6358d95539fb18d6a6262ab8c5e36 100644 --- a/core/modules/field/src/Tests/FieldAccessTest.php +++ b/core/modules/field/src/Tests/FieldAccessTest.php @@ -46,13 +46,13 @@ protected function setUp() { $content_type = $content_type_info->type; $field_storage = array( - 'name' => 'test_view_field', + 'field_name' => 'test_view_field', 'entity_type' => 'node', 'type' => 'text', ); entity_create('field_storage_config', $field_storage)->save(); $field = array( - 'field_name' => $field_storage['name'], + 'field_name' => $field_storage['field_name'], 'entity_type' => 'node', 'bundle' => $content_type, ); @@ -61,7 +61,7 @@ protected function setUp() { // Assign display properties for the 'default' and 'teaser' view modes. foreach (array('default', 'teaser') as $view_mode) { entity_get_display('node', $content_type, $view_mode) - ->setComponent($field_storage['name']) + ->setComponent($field_storage['field_name']) ->save(); } diff --git a/core/modules/field/src/Tests/FieldAttachStorageTest.php b/core/modules/field/src/Tests/FieldAttachStorageTest.php index dbcdfaa6c74be6a7447ed91713b93b979decab2b..205dd207c1e28fe1c1d7560496fb807e18ad7716 100644 --- a/core/modules/field/src/Tests/FieldAttachStorageTest.php +++ b/core/modules/field/src/Tests/FieldAttachStorageTest.php @@ -95,7 +95,7 @@ function testFieldAttachLoadMultiple() { for ($i = 1; $i <= 3; $i++) { $field_names[$i] = 'field_' . $i; $field_storage = entity_create('field_storage_config', array( - 'name' => $field_names[$i], + 'field_name' => $field_names[$i], 'entity_type' => $entity_type, 'type' => 'test_field', )); @@ -331,7 +331,7 @@ function testEntityDeleteBundle() { // Create a second field for the test bundle $field_name = drupal_strtolower($this->randomMachineName() . '_field_name'); $field_storage = array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => $entity_type, 'type' => 'test_field', 'cardinality' => 1, diff --git a/core/modules/field/src/Tests/FieldCrudTest.php b/core/modules/field/src/Tests/FieldCrudTest.php index 9e682ffa43cb697fc4d40b1d1ef3e27d425a2a41..e574077bd702bb0a927ec4b9936f6f24e935bc94 100644 --- a/core/modules/field/src/Tests/FieldCrudTest.php +++ b/core/modules/field/src/Tests/FieldCrudTest.php @@ -44,7 +44,7 @@ function setUp() { parent::setUp(); $this->fieldStorageDefinition = array( - 'name' => drupal_strtolower($this->randomMachineName()), + 'field_name' => drupal_strtolower($this->randomMachineName()), 'entity_type' => 'entity_test', 'type' => 'test_field', ); @@ -191,8 +191,8 @@ function testDeleteFieldCrossDeletion() { entity_create('field_config', $this->fieldDefinition)->save(); entity_create('field_config', $field_definition_2)->save(); $field_storage->delete(); - $this->assertFalse(FieldConfig::loadByName('entity_test', $this->fieldDefinition['bundle'], $field_storage->name)); - $this->assertFalse(FieldConfig::loadByName('entity_test', $field_definition_2['bundle'], $field_storage->name)); + $this->assertFalse(FieldConfig::loadByName('entity_test', $this->fieldDefinition['bundle'], $field_storage->field_name)); + $this->assertFalse(FieldConfig::loadByName('entity_test', $field_definition_2['bundle'], $field_storage->field_name)); // Chack that deletion of the last field deletes the storage. $field_storage = entity_create('field_storage_config', $this->fieldStorageDefinition); @@ -202,9 +202,9 @@ function testDeleteFieldCrossDeletion() { $field_2 = entity_create('field_config', $field_definition_2); $field_2->save(); $field->delete(); - $this->assertTrue(FieldStorageConfig::loadByName('entity_test', $field_storage->name)); + $this->assertTrue(FieldStorageConfig::loadByName('entity_test', $field_storage->field_name)); $field_2->delete(); - $this->assertFalse(FieldStorageConfig::loadByName('entity_test', $field_storage->name)); + $this->assertFalse(FieldStorageConfig::loadByName('entity_test', $field_storage->field_name)); // Check that deletion of all fields using a storage simultaneously deletes // the storage. @@ -215,7 +215,7 @@ function testDeleteFieldCrossDeletion() { $field_2 = entity_create('field_config', $field_definition_2); $field_2->save(); $this->container->get('entity.manager')->getStorage('field_config')->delete(array($field, $field_2)); - $this->assertFalse(FieldStorageConfig::loadByName('entity_test', $field_storage->name)); + $this->assertFalse(FieldStorageConfig::loadByName('entity_test', $field_storage->field_name)); } } diff --git a/core/modules/field/src/Tests/FieldDataCountTest.php b/core/modules/field/src/Tests/FieldDataCountTest.php index 7f78601238d3750f8d953ce532d8ad249fbb3358..967e60f028787779f365934bdf3d59f52a13cab2 100644 --- a/core/modules/field/src/Tests/FieldDataCountTest.php +++ b/core/modules/field/src/Tests/FieldDataCountTest.php @@ -40,7 +40,7 @@ public function testEntityCountAndHasData() { // entities and not rows in a table. /** @var \Drupal\field\Entity\FieldStorageConfig $field_storage */ $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_int', + 'field_name' => 'field_int', 'entity_type' => 'entity_test', 'type' => 'integer', 'cardinality' => 2, diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php index 975a6cbd7a5db30a8c9f61cc002d25fbf98ca065..188cceb3b66cf07777e3929b9f2ed21a65963724 100644 --- a/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php +++ b/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php @@ -41,7 +41,7 @@ public function testImportDeleteUninstall() { // \Drupal\field\ConfigImporterFieldPurger does not purge fields that are // not related to the configuration synchronization. $unrelated_field_storage = entity_create('field_storage_config', array( - 'name' => 'field_int', + 'field_name' => 'field_int', 'entity_type' => 'entity_test', 'type' => 'integer', )); @@ -53,7 +53,7 @@ public function testImportDeleteUninstall() { // Create a telephone field for validation. $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_test', + 'field_name' => 'field_test', 'entity_type' => 'entity_test', 'type' => 'telephone', )); @@ -115,7 +115,7 @@ public function testImportDeleteUninstall() { public function testImportAlreadyDeletedUninstall() { // Create a telephone field for validation. $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_test', + 'field_name' => 'field_test', 'entity_type' => 'entity_test', 'type' => 'telephone', )); diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php index 61091adef552b12ebfd5f2b082a4ccf0321b8f99..d7a7b6cca9127e384662a825f193792804d4d8d0 100644 --- a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php +++ b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php @@ -38,7 +38,7 @@ protected function setUp() { public function testImportDeleteUninstall() { // Create a telephone field. $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_tel', + 'field_name' => 'field_tel', 'entity_type' => 'entity_test', 'type' => 'telephone', )); @@ -50,7 +50,7 @@ public function testImportDeleteUninstall() { // Create a text field. $text_field_storage = entity_create('field_storage_config', array( - 'name' => 'field_text', + 'field_name' => 'field_text', 'entity_type' => 'entity_test', 'type' => 'text', )); diff --git a/core/modules/field/src/Tests/FieldStorageCrudTest.php b/core/modules/field/src/Tests/FieldStorageCrudTest.php index d5a59ee2d894782c05df98d692aa40c3c4aa16c9..3bc623671a79a01266d79b00d29c887ed235041f 100644 --- a/core/modules/field/src/Tests/FieldStorageCrudTest.php +++ b/core/modules/field/src/Tests/FieldStorageCrudTest.php @@ -36,7 +36,7 @@ class FieldStorageCrudTest extends FieldUnitTestBase { */ function testCreate() { $field_storage_definition = array( - 'name' => 'field_2', + 'field_name' => 'field_2', 'entity_type' => 'entity_test', 'type' => 'test_field', ); @@ -44,7 +44,7 @@ function testCreate() { $field_storage = entity_create('field_storage_config', $field_storage_definition); $field_storage->save(); $mem = field_test_memorize(); - $this->assertIdentical($mem['field_test_field_storage_config_create'][0][0]->getName(), $field_storage_definition['name'], 'hook_entity_create() called with correct arguments.'); + $this->assertIdentical($mem['field_test_field_storage_config_create'][0][0]->getName(), $field_storage_definition['field_name'], 'hook_entity_create() called with correct arguments.'); $this->assertIdentical($mem['field_test_field_storage_config_create'][0][0]->getType(), $field_storage_definition['type'], 'hook_entity_create() called with correct arguments.'); // Read the configuration. Check against raw configuration data rather than @@ -53,9 +53,9 @@ function testCreate() { $field_storage_config = \Drupal::config('field.storage.' . $field_storage->id())->get(); // Ensure that basic properties are preserved. - $this->assertEqual($field_storage_config['name'], $field_storage_definition['name'], 'The field name is properly saved.'); + $this->assertEqual($field_storage_config['field_name'], $field_storage_definition['field_name'], 'The field name is properly saved.'); $this->assertEqual($field_storage_config['entity_type'], $field_storage_definition['entity_type'], 'The field entity type is properly saved.'); - $this->assertEqual($field_storage_config['id'], $field_storage_definition['entity_type'] . '.' . $field_storage_definition['name'], 'The field id is properly saved.'); + $this->assertEqual($field_storage_config['id'], $field_storage_definition['entity_type'] . '.' . $field_storage_definition['field_name'], 'The field id is properly saved.'); $this->assertEqual($field_storage_config['type'], $field_storage_definition['type'], 'The field type is properly saved.'); // Ensure that cardinality defaults to 1. @@ -77,7 +77,7 @@ function testCreate() { // Check that field type is required. try { $field_storage_definition = array( - 'name' => 'field_1', + 'field_name' => 'field_1', 'entity_type' => 'entity_type', ); entity_create('field_storage_config', $field_storage_definition)->save(); @@ -102,7 +102,7 @@ function testCreate() { // Check that entity type is required. try { $field_storage_definition = array( - 'name' => 'test_field', + 'field_name' => 'test_field', 'type' => 'test_field' ); entity_create('field_storage_config', $field_storage_definition)->save(); @@ -115,7 +115,7 @@ function testCreate() { // Check that field name must start with a letter or _. try { $field_storage_definition = array( - 'name' => '2field_2', + 'field_name' => '2field_2', 'entity_type' => 'entity_test', 'type' => 'test_field', ); @@ -129,7 +129,7 @@ function testCreate() { // Check that field name must only contain lowercase alphanumeric or _. try { $field_storage_definition = array( - 'name' => 'field#_3', + 'field_name' => 'field#_3', 'entity_type' => 'entity_test', 'type' => 'test_field', ); @@ -143,7 +143,7 @@ function testCreate() { // Check that field name cannot be longer than 32 characters long. try { $field_storage_definition = array( - 'name' => '_12345678901234567890123456789012', + 'field_name' => '_12345678901234567890123456789012', 'entity_type' => 'entity_test', 'type' => 'test_field', ); @@ -159,7 +159,7 @@ function testCreate() { try { $field_storage_definition = array( 'type' => 'test_field', - 'name' => 'id', + 'field_name' => 'id', 'entity_type' => 'entity_test', ); entity_create('field_storage_config', $field_storage_definition)->save(); @@ -181,7 +181,7 @@ function testCreateWithExplicitSchema() { 'dummy' => 'foobar' ); $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_2', + 'field_name' => 'field_2', 'entity_type' => 'entity_test', 'type' => 'test_field', 'schema' => $schema, @@ -194,7 +194,7 @@ function testCreateWithExplicitSchema() { */ function testRead() { $field_storage_definition = array( - 'name' => 'field_1', + 'field_name' => 'field_1', 'entity_type' => 'entity_test', 'type' => 'test_field', ); @@ -203,18 +203,18 @@ function testRead() { $id = $field_storage->id(); // Check that 'single column' criteria works. - $fields = entity_load_multiple_by_properties('field_storage_config', array('field_name' => $field_storage_definition['name'])); + $fields = entity_load_multiple_by_properties('field_storage_config', array('field_name' => $field_storage_definition['field_name'])); $this->assertTrue(count($fields) == 1 && isset($fields[$id]), 'The field was properly read.'); // Check that 'multi column' criteria works. - $fields = entity_load_multiple_by_properties('field_storage_config', array('field_name' => $field_storage_definition['name'], 'type' => $field_storage_definition['type'])); + $fields = entity_load_multiple_by_properties('field_storage_config', array('field_name' => $field_storage_definition['field_name'], 'type' => $field_storage_definition['type'])); $this->assertTrue(count($fields) == 1 && isset($fields[$id]), 'The field was properly read.'); - $fields = entity_load_multiple_by_properties('field_storage_config', array('field_name' => $field_storage_definition['name'], 'type' => 'foo')); + $fields = entity_load_multiple_by_properties('field_storage_config', array('field_name' => $field_storage_definition['field_name'], 'type' => 'foo')); $this->assertTrue(empty($fields), 'No field was found.'); // Create a field from the field storage. $field_definition = array( - 'field_name' => $field_storage_definition['name'], + 'field_name' => $field_storage_definition['field_name'], 'entity_type' => 'entity_test', 'bundle' => 'entity_test', ); @@ -227,7 +227,7 @@ function testRead() { function testIndexes() { // Check that indexes specified by the field type are used by default. $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_1', + 'field_name' => 'field_1', 'entity_type' => 'entity_test', 'type' => 'test_field', )); @@ -240,7 +240,7 @@ function testIndexes() { // Check that indexes specified by the field definition override the field // type indexes. $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_2', + 'field_name' => 'field_2', 'entity_type' => 'entity_test', 'type' => 'test_field', 'indexes' => array( @@ -256,7 +256,7 @@ function testIndexes() { // Check that indexes specified by the field definition add to the field // type indexes. $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_3', + 'field_name' => 'field_3', 'entity_type' => 'entity_test', 'type' => 'test_field', 'indexes' => array( @@ -279,13 +279,13 @@ function testDelete() { // Create two fields (so we can test that only one is deleted). $field_storage_definition = array( - 'name' => 'field_1', + 'field_name' => 'field_1', 'type' => 'test_field', 'entity_type' => 'entity_test', ); entity_create('field_storage_config', $field_storage_definition)->save(); $another_field_storage_definition = array( - 'name' => 'field_2', + 'field_name' => 'field_2', 'type' => 'test_field', 'entity_type' => 'entity_test', ); @@ -293,23 +293,23 @@ function testDelete() { // Create fields for each. $field_definition = array( - 'field_name' => $field_storage_definition['name'], + 'field_name' => $field_storage_definition['field_name'], 'entity_type' => 'entity_test', 'bundle' => 'entity_test', ); entity_create('field_config', $field_definition)->save(); $another_field_definition = $field_definition; - $another_field_definition['field_name'] = $another_field_storage_definition['name']; + $another_field_definition['field_name'] = $another_field_storage_definition['field_name']; entity_create('field_config', $another_field_definition)->save(); // Test that the first field is not deleted, and then delete it. - $field_storage = current(entity_load_multiple_by_properties('field_storage_config', array('field_name' => $field_storage_definition['name'], 'include_deleted' => TRUE))); + $field_storage = current(entity_load_multiple_by_properties('field_storage_config', array('field_name' => $field_storage_definition['field_name'], 'include_deleted' => TRUE))); $this->assertTrue(!empty($field_storage) && empty($field_storage->deleted), 'A new storage is not marked for deletion.'); - FieldStorageConfig::loadByName('entity_test', $field_storage_definition['name'])->delete(); + FieldStorageConfig::loadByName('entity_test', $field_storage_definition['field_name'])->delete(); // Make sure that the field is marked as deleted when it is specifically // loaded. - $field_storage = current(entity_load_multiple_by_properties('field_storage_config', array('field_name' => $field_storage_definition['name'], 'include_deleted' => TRUE))); + $field_storage = current(entity_load_multiple_by_properties('field_storage_config', array('field_name' => $field_storage_definition['field_name'], 'include_deleted' => TRUE))); $this->assertTrue(!empty($field_storage->deleted), 'A deleted storage is marked for deletion.'); // Make sure that this field is marked as deleted when it is @@ -318,7 +318,7 @@ function testDelete() { $this->assertTrue(!empty($field->deleted), 'A field whose storage was deleted is marked for deletion.'); // Try to load the storage normally and make sure it does not show up. - $field_storage = entity_load('field_storage_config', 'entity_test.' . $field_storage_definition['name']); + $field_storage = entity_load('field_storage_config', 'entity_test.' . $field_storage_definition['field_name']); $this->assertTrue(empty($field_storage), 'A deleted storage is not loaded by default.'); // Try to load the field normally and make sure it does not show up. @@ -326,7 +326,7 @@ function testDelete() { $this->assertTrue(empty($field), 'A field whose storage was deleted is not loaded by default.'); // Make sure the other field and its storage are not deleted. - $another_field_storage = entity_load('field_storage_config', 'entity_test.' . $another_field_storage_definition['name']); + $another_field_storage = entity_load('field_storage_config', 'entity_test.' . $another_field_storage_definition['field_name']); $this->assertTrue(!empty($another_field_storage) && empty($another_field_storage->deleted), 'A non-deleted storage is not marked for deletion.'); $another_field = entity_load('field_config', 'entity_test.' . $another_field_definition['bundle'] . '.' . $another_field_definition['field_name']); $this->assertTrue(!empty($another_field) && empty($another_field->deleted), 'A field whose storage was not deleted is not marked for deletion.'); @@ -335,7 +335,7 @@ function testDelete() { // write data into it. entity_create('field_storage_config', $field_storage_definition)->save(); entity_create('field_config', $field_definition)->save(); - $field_storage = entity_load('field_storage_config', 'entity_test.' . $field_storage_definition['name']); + $field_storage = entity_load('field_storage_config', 'entity_test.' . $field_storage_definition['field_name']); $this->assertTrue(!empty($field_storage) && empty($field_storage->deleted), 'A new storage with a previously used name is created.'); $field = entity_load('field_config', 'entity_test.' . $field_definition['bundle'] . '.' . $field_definition['field_name'] ); $this->assertTrue(!empty($field) && empty($field->deleted), 'A new field for a previously used field name is created.'); @@ -355,7 +355,7 @@ function testDelete() { function testUpdateFieldType() { $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_type', + 'field_name' => 'field_type', 'entity_type' => 'entity_test', 'type' => 'decimal', )); @@ -380,7 +380,7 @@ function testUpdate() { // systems, it makes a good test case. $cardinality = 4; $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_update', + 'field_name' => 'field_update', 'entity_type' => 'entity_test', 'type' => 'test_field', 'cardinality' => $cardinality, @@ -418,7 +418,7 @@ function testUpdate() { */ function testUpdateForbid() { $field_storage = entity_create('field_storage_config', array( - 'name' => 'forbidden', + 'field_name' => 'forbidden', 'entity_type' => 'entity_test', 'type' => 'test_field', 'settings' => array( diff --git a/core/modules/field/src/Tests/FieldUnitTestBase.php b/core/modules/field/src/Tests/FieldUnitTestBase.php index de405a0a2b95fba53eb37233c94775ef3b39709c..6fc45b1d47e03106923b06f87cce5627d2e5145c 100644 --- a/core/modules/field/src/Tests/FieldUnitTestBase.php +++ b/core/modules/field/src/Tests/FieldUnitTestBase.php @@ -91,7 +91,7 @@ protected function createFieldWithStorage($suffix = '', $entity_type = 'entity_t $this->fieldTestData->$field_name = drupal_strtolower($this->randomMachineName() . '_field_name' . $suffix); $this->fieldTestData->$field_storage = entity_create('field_storage_config', array( - 'name' => $this->fieldTestData->$field_name, + 'field_name' => $this->fieldTestData->$field_name, 'entity_type' => $entity_type, 'type' => 'test_field', 'cardinality' => 4, diff --git a/core/modules/field/src/Tests/FormTest.php b/core/modules/field/src/Tests/FormTest.php index a97514ed18154a078b9e7853c261a63b251028f2..67c8baa519840d54b16d24b63cec9c398104eff5 100644 --- a/core/modules/field/src/Tests/FormTest.php +++ b/core/modules/field/src/Tests/FormTest.php @@ -60,18 +60,18 @@ protected function setUp() { $this->drupalLogin($web_user); $this->fieldStorageSingle = array( - 'name' => 'field_single', + 'field_name' => 'field_single', 'entity_type' => 'entity_test', 'type' => 'test_field', ); $this->fieldStorageMultiple = array( - 'name' => 'field_multiple', + 'field_name' => 'field_multiple', 'entity_type' => 'entity_test', 'type' => 'test_field', 'cardinality' => 4, ); $this->fieldStorageUnlimited = array( - 'name' => 'field_unlimited', + 'field_name' => 'field_unlimited', 'entity_type' => 'entity_test', 'type' => 'test_field', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, @@ -91,7 +91,7 @@ protected function setUp() { function testFieldFormSingle() { $field_storage = $this->fieldStorageSingle; - $field_name = $field_storage['name']; + $field_name = $field_storage['field_name']; $this->field['field_name'] = $field_name; entity_create('field_storage_config', $field_storage)->save(); entity_create('field_config', $this->field)->save(); @@ -165,7 +165,7 @@ function testFieldFormSingle() { */ function testFieldFormDefaultValue() { $field_storage = $this->fieldStorageSingle; - $field_name = $field_storage['name']; + $field_name = $field_storage['field_name']; $this->field['field_name'] = $field_name; $default = rand(1, 127); $this->field['default_value'] = array(array('value' => $default)); @@ -194,7 +194,7 @@ function testFieldFormDefaultValue() { function testFieldFormSingleRequired() { $field_storage = $this->fieldStorageSingle; - $field_name = $field_storage['name']; + $field_name = $field_storage['field_name']; $this->field['field_name'] = $field_name; $this->field['required'] = TRUE; entity_create('field_storage_config', $field_storage)->save(); @@ -239,7 +239,7 @@ function testFieldFormSingleRequired() { function testFieldFormUnlimited() { $field_storage = $this->fieldStorageUnlimited; - $field_name = $field_storage['name']; + $field_name = $field_storage['field_name']; $this->field['field_name'] = $field_name; entity_create('field_storage_config', $field_storage)->save(); entity_create('field_config', $this->field)->save(); @@ -322,7 +322,7 @@ function testFieldFormUnlimited() { function testFieldFormMultivalueWithRequiredRadio() { // Create a multivalue test field. $field_storage = $this->fieldStorageUnlimited; - $field_name = $field_storage['name']; + $field_name = $field_storage['field_name']; $this->field['field_name'] = $field_name; entity_create('field_storage_config', $field_storage)->save(); entity_create('field_config', $this->field)->save(); @@ -332,7 +332,7 @@ function testFieldFormMultivalueWithRequiredRadio() { // Add a required radio field. entity_create('field_storage_config', array( - 'name' => 'required_radio_test', + 'field_name' => 'required_radio_test', 'entity_type' => 'entity_test', 'type' => 'list_string', 'settings' => array( @@ -369,7 +369,7 @@ function testFieldFormMultivalueWithRequiredRadio() { function testFieldFormJSAddMore() { $field_storage = $this->fieldStorageUnlimited; - $field_name = $field_storage['name']; + $field_name = $field_storage['field_name']; $this->field['field_name'] = $field_name; entity_create('field_storage_config', $field_storage)->save(); entity_create('field_config', $this->field)->save(); @@ -430,7 +430,7 @@ function testFieldFormMultipleWidget() { // Create a field with fixed cardinality, configure the form to use a // "multiple" widget. $field_storage = $this->fieldStorageMultiple; - $field_name = $field_storage['name']; + $field_name = $field_storage['field_name']; $this->field['field_name'] = $field_name; entity_create('field_storage_config', $field_storage)->save(); entity_create('field_config', $this->field)->save(); @@ -476,7 +476,7 @@ function testFieldFormAccess() { // Create a "regular" field. $field_storage = $this->fieldStorageSingle; $field_storage['entity_type'] = $entity_type; - $field_name = $field_storage['name']; + $field_name = $field_storage['field_name']; $field = $this->field; $field['field_name'] = $field_name; $field['entity_type'] = $entity_type; @@ -490,11 +490,11 @@ function testFieldFormAccess() { // Create a field with no edit access. See // field_test_entity_field_access(). $field_storage_no_access = array( - 'name' => 'field_no_edit_access', + 'field_name' => 'field_no_edit_access', 'entity_type' => $entity_type, 'type' => 'test_field', ); - $field_name_no_access = $field_storage_no_access['name']; + $field_name_no_access = $field_storage_no_access['field_name']; $field_no_access = array( 'field_name' => $field_name_no_access, 'entity_type' => $entity_type, @@ -561,7 +561,7 @@ function testHiddenField() { $entity_type = 'entity_test_rev'; $field_storage = $this->fieldStorageSingle; $field_storage['entity_type'] = $entity_type; - $field_name = $field_storage['name']; + $field_name = $field_storage['field_name']; $this->field['field_name'] = $field_name; $this->field['default_value'] = array(0 => array('value' => 99)); $this->field['entity_type'] = $entity_type; diff --git a/core/modules/field/src/Tests/NestedFormTest.php b/core/modules/field/src/Tests/NestedFormTest.php index 6f0605ac0aaf67160487ad268a2a11287fd08eeb..5067b976f59e5f176532270cd098e4f9a65cfb25 100644 --- a/core/modules/field/src/Tests/NestedFormTest.php +++ b/core/modules/field/src/Tests/NestedFormTest.php @@ -29,12 +29,12 @@ protected function setUp() { $this->drupalLogin($web_user); $this->fieldStorageSingle = array( - 'name' => 'field_single', + 'field_name' => 'field_single', 'entity_type' => 'entity_test', 'type' => 'test_field', ); $this->fieldStorageUnlimited = array( - 'name' => 'field_unlimited', + 'field_name' => 'field_unlimited', 'entity_type' => 'entity_test', 'type' => 'test_field', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/field/src/Tests/Number/NumberFieldTest.php b/core/modules/field/src/Tests/Number/NumberFieldTest.php index 0dab208323f035dd38cd6c63176631928a908a56..dfec2f95990645dd6d3a371c76e00ca37f88a9f6 100644 --- a/core/modules/field/src/Tests/Number/NumberFieldTest.php +++ b/core/modules/field/src/Tests/Number/NumberFieldTest.php @@ -44,7 +44,7 @@ function testNumberDecimalField() { // Create a field with settings to validate. $field_name = drupal_strtolower($this->randomMachineName()); entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'decimal', 'settings' => array( @@ -134,7 +134,7 @@ function testNumberIntegerField() { // Create a field with settings to validate. $field_name = drupal_strtolower($this->randomMachineName()); entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'integer', ))->save(); @@ -228,7 +228,7 @@ function testNumberFloatField() { // Create a field with settings to validate. $field_name = drupal_strtolower($this->randomMachineName()); entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'float', ))->save(); @@ -325,13 +325,13 @@ function testNumberFormatter() { $this->drupalCreateContentType(array('type' => $type)); entity_create('field_storage_config', array( - 'name' => $float_field, + 'field_name' => $float_field, 'entity_type' => 'node', 'type' => 'float', ))->save(); entity_create('field_storage_config', array( - 'name' => $integer_field, + 'field_name' => $integer_field, 'entity_type' => 'node', 'type' => 'integer', ))->save(); diff --git a/core/modules/field/src/Tests/Number/NumberItemTest.php b/core/modules/field/src/Tests/Number/NumberItemTest.php index 6606b49ad9a9ef62c7471c6571bab31bfe306087..4390449ae7f3870e00898a5b14abb6244f30c8d5 100644 --- a/core/modules/field/src/Tests/Number/NumberItemTest.php +++ b/core/modules/field/src/Tests/Number/NumberItemTest.php @@ -31,8 +31,8 @@ protected function setUp() { // Create number field storages and fields for validation. foreach (array('integer', 'float', 'decimal') as $type) { entity_create('field_storage_config', array( - 'name' => 'field_' . $type, 'entity_type' => 'entity_test', + 'field_name' => 'field_' . $type, 'type' => $type, ))->save(); entity_create('field_config', array( diff --git a/core/modules/field/src/Tests/ShapeItemTest.php b/core/modules/field/src/Tests/ShapeItemTest.php index 4b9671c82c298a66697557f724dc1e8260e3e40a..548d63e1c73e8f8125877b84faaacd727333a8b8 100644 --- a/core/modules/field/src/Tests/ShapeItemTest.php +++ b/core/modules/field/src/Tests/ShapeItemTest.php @@ -36,7 +36,7 @@ protected function setUp() { // Create a 'shape' field and storage for validation. entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'entity_test', 'type' => 'shape', ))->save(); diff --git a/core/modules/field/src/Tests/String/StringFormatterTest.php b/core/modules/field/src/Tests/String/StringFormatterTest.php index a9fce32cc83773411bd40a935fb5af8722e73c40..8ee3a1775861f63f10cb548e64d245ae146a63b3 100644 --- a/core/modules/field/src/Tests/String/StringFormatterTest.php +++ b/core/modules/field/src/Tests/String/StringFormatterTest.php @@ -65,7 +65,7 @@ protected function setUp() { $this->fieldName = Unicode::strtolower($this->randomMachineName()); $field_storage = FieldStorageConfig::create(array( - 'name' => $this->fieldName, + 'field_name' => $this->fieldName, 'entity_type' => $this->entityType, 'type' => 'string', )); diff --git a/core/modules/field/src/Tests/TestItemTest.php b/core/modules/field/src/Tests/TestItemTest.php index a433c000c76e723cebc6f82fdf9ac440c540dc13..6b41870bd7a0be8488ddbed0585ea2db793c17d6 100644 --- a/core/modules/field/src/Tests/TestItemTest.php +++ b/core/modules/field/src/Tests/TestItemTest.php @@ -37,7 +37,7 @@ protected function setUp() { // Create a 'test_field' field and storage for validation. entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'entity_test', 'type' => 'test_field', ))->save(); diff --git a/core/modules/field/src/Tests/TranslationTest.php b/core/modules/field/src/Tests/TranslationTest.php index 50e779bff624864eebf3eadc1c9fa140224961ec..69621557e6383e2de473ac390c2bee76d5a203ce 100644 --- a/core/modules/field/src/Tests/TranslationTest.php +++ b/core/modules/field/src/Tests/TranslationTest.php @@ -80,7 +80,7 @@ protected function setUp() { $this->entity_type = 'entity_test'; $this->field_storage_definition = array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => $this->entity_type, 'type' => 'test_field', 'cardinality' => 4, @@ -140,7 +140,7 @@ function testTranslatableFieldSaveLoad() { // Test default values. $field_name_default = drupal_strtolower($this->randomMachineName() . '_field_name'); $field_storage_definition = $this->field_storage_definition; - $field_storage_definition['name'] = $field_name_default; + $field_storage_definition['field_name'] = $field_name_default; $field_storage = entity_create('field_storage_config', $field_storage_definition); $field_storage->save(); diff --git a/core/modules/field/src/Tests/TranslationWebTest.php b/core/modules/field/src/Tests/TranslationWebTest.php index 3f11b49539df17199e01e3767613d9fab9ddb604..9b08388ec3ca9a50230ab7c1059ba74e2bf0f2c8 100644 --- a/core/modules/field/src/Tests/TranslationWebTest.php +++ b/core/modules/field/src/Tests/TranslationWebTest.php @@ -57,7 +57,7 @@ protected function setUp() { $this->field_name = drupal_strtolower($this->randomMachineName() . '_field_name'); $field_storage = array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => $this->entity_type, 'type' => 'test_field', 'cardinality' => 4, diff --git a/core/modules/field/src/Tests/Views/FieldTestBase.php b/core/modules/field/src/Tests/Views/FieldTestBase.php index 649703e56aca2a893f963c6253a1992ef8b3baa2..0425c29edab70216cbbaabcf3791f99f80bd33a1 100644 --- a/core/modules/field/src/Tests/Views/FieldTestBase.php +++ b/core/modules/field/src/Tests/Views/FieldTestBase.php @@ -67,7 +67,7 @@ function setUpFieldStorages($amount = 3, $type = 'string') { for ($i = 0; $i < $amount; $i++) { $field_names[$i] = 'field_name_' . $i; $this->fieldStorages[$i] = entity_create('field_storage_config', array( - 'name' => $field_names[$i], + 'field_name' => $field_names[$i], 'entity_type' => 'node', 'type' => $type, )); diff --git a/core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php b/core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php index 54cf3de5d842ae9d46f6661475993798193a4e3f..36e903d85c0445b651df03196db11eae7696d288 100644 --- a/core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php +++ b/core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php @@ -43,7 +43,7 @@ protected function setUp() { // Setup a field with cardinality > 1. $this->fieldStorages[3] = entity_create('field_storage_config', array( - 'name' => 'field_name_3', + 'field_name' => 'field_name_3', 'entity_type' => 'node', 'type' => 'string', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, @@ -51,7 +51,7 @@ protected function setUp() { $this->fieldStorages[3]->save(); // Setup a field that will have no value. $this->fieldStorages[4] = entity_create('field_storage_config', array( - 'name' => 'field_name_4', + 'field_name' => 'field_name_4', 'entity_type' => 'node', 'type' => 'string', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, @@ -60,7 +60,7 @@ protected function setUp() { // Setup a text field. $this->fieldStorages[5] = entity_create('field_storage_config', array( - 'name' => 'field_name_5', + 'field_name' => 'field_name_5', 'entity_type' => 'node', 'type' => 'text', )); diff --git a/core/modules/field/src/Tests/reEnableModuleFieldTest.php b/core/modules/field/src/Tests/reEnableModuleFieldTest.php index c7bdcf69fd0b8bfd8602026e03fde4e3115d94e4..2b8f4c14d3414fbf04a812220460b9da7fa15ee6 100644 --- a/core/modules/field/src/Tests/reEnableModuleFieldTest.php +++ b/core/modules/field/src/Tests/reEnableModuleFieldTest.php @@ -44,7 +44,7 @@ function testReEnabledField() { // Add a telephone field to the article content type. $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_telephone', + 'field_name' => 'field_telephone', 'entity_type' => 'node', 'type' => 'telephone', )); diff --git a/core/modules/field/tests/modules/field_test_config/config/install/field.storage.entity_test.field_test_import.yml b/core/modules/field/tests/modules/field_test_config/config/install/field.storage.entity_test.field_test_import.yml index 32f1cc8dcf3cb207f4a2fbd3381af32fbc426c1b..33fdf5267b9bb93fecc695ce3dd502fc3158f9b7 100644 --- a/core/modules/field/tests/modules/field_test_config/config/install/field.storage.entity_test.field_test_import.yml +++ b/core/modules/field/tests/modules/field_test_config/config/install/field.storage.entity_test.field_test_import.yml @@ -1,6 +1,6 @@ id: entity_test.field_test_import langcode: und -name: field_test_import +field_name: field_test_import entity_type: entity_test type: text settings: diff --git a/core/modules/field/tests/modules/field_test_config/config/install/field.storage.entity_test.field_test_import_2.yml b/core/modules/field/tests/modules/field_test_config/config/install/field.storage.entity_test.field_test_import_2.yml index cd4bf750540a96b8663b9a9161b6f52ed470985b..69874a43e204859e67f4121c04500683703607c7 100644 --- a/core/modules/field/tests/modules/field_test_config/config/install/field.storage.entity_test.field_test_import_2.yml +++ b/core/modules/field/tests/modules/field_test_config/config/install/field.storage.entity_test.field_test_import_2.yml @@ -1,6 +1,6 @@ id: entity_test.field_test_import_2 langcode: und -name: field_test_import_2 +field_name: field_test_import_2 entity_type: entity_test type: text settings: diff --git a/core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging.yml b/core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging.yml index 057c0348a01c6955f05ad01f038d7f0bdb683233..495049afbe1eefe1d312e064d1b9e9a3aa1b72a6 100644 --- a/core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging.yml +++ b/core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging.yml @@ -1,7 +1,7 @@ id: entity_test.field_test_import_staging uuid: 0bf654cc-f14a-4881-b94c-76959e47466b langcode: und -name: field_test_import_staging +field_name: field_test_import_staging entity_type: entity_test type: text settings: diff --git a/core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging_2.yml b/core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging_2.yml index d5d896433645173794c5b2a3a5a21d06fd9ae9d8..6b8ef2c04e6bff3674e78be5e1c91b551c63b160 100644 --- a/core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging_2.yml +++ b/core/modules/field/tests/modules/field_test_config/staging/field.storage.entity_test.field_test_import_staging_2.yml @@ -1,7 +1,7 @@ id: entity_test.field_test_import_staging_2 uuid: 2165d9aa-9a0c-41a1-be02-2a49f3405c00 langcode: und -name: field_test_import_staging_2 +field_name: field_test_import_staging_2 entity_type: entity_test type: text settings: diff --git a/core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php b/core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php index 3c536a3d7d01fe072e204d32dc82cab72c5d6398..cd05b9b9991fbdb2bdfa3dde9d8592eb33e8cca0 100644 --- a/core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php +++ b/core/modules/field/tests/src/Unit/FieldStorageConfigEntityUnitTest.php @@ -93,8 +93,12 @@ public function testCalculateDependencies() { ->with('field_storage_config') ->will($this->returnValue($fieldStorageConfigentityType)); - $values = array('name' => 'test_field', 'type' => 'test_field_type', 'entity_type' => $attached_entity_type_id, 'module' => 'test_module'); - $field_storage = new FieldStorageConfig($values); + $field_storage = new FieldStorageConfig(array( + 'entity_type' => $attached_entity_type_id, + 'field_name' => 'test_field', + 'type' => 'test_field_type', + 'module' => 'test_module', + )); $dependencies = $field_storage->calculateDependencies(); $this->assertContains('test_module', $dependencies['module']); diff --git a/core/modules/field_ui/src/FieldOverview.php b/core/modules/field_ui/src/FieldOverview.php index 0af938cfb93e00028dc183b4b43c97388746826b..0e42fcd6f37a1351330354f2516b048882d4307b 100644 --- a/core/modules/field_ui/src/FieldOverview.php +++ b/core/modules/field_ui/src/FieldOverview.php @@ -370,7 +370,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $values = $form_values['_add_new_field']; $field_storage = array( - 'name' => $values['field_name'], + 'field_name' => $values['field_name'], 'entity_type' => $this->entity_type, 'type' => $values['type'], 'translatable' => $values['translatable'], diff --git a/core/modules/field_ui/src/FieldStorageConfigListBuilder.php b/core/modules/field_ui/src/FieldStorageConfigListBuilder.php index 1eef291afb42c96c4285135c174e7cf36926d4da..626647ca576aa179e81e00d85e1374c1f569a00f 100644 --- a/core/modules/field_ui/src/FieldStorageConfigListBuilder.php +++ b/core/modules/field_ui/src/FieldStorageConfigListBuilder.php @@ -97,25 +97,25 @@ public function buildHeader() { /** * {@inheritdoc} */ - public function buildRow(EntityInterface $field) { - if ($field->locked) { + public function buildRow(EntityInterface $field_storage) { + if ($field_storage->locked) { $row['class'] = array('menu-disabled'); - $row['data']['id'] = t('@field_name (Locked)', array('@field_name' => $field->name)); + $row['data']['id'] = t('@field_name (Locked)', array('@field_name' => $field_storage->field_name)); } else { - $row['data']['id'] = $field->name; + $row['data']['id'] = $field_storage->field_name; } - $field_type = $this->fieldTypes[$field->type]; + $field_type = $this->fieldTypes[$field_storage->type]; $row['data']['type'] = t('@type (module: @module)', array('@type' => $field_type['label'], '@module' => $field_type['provider'])); $usage = array(); - foreach ($field->getBundles() as $bundle) { - if ($route_info = FieldUI::getOverviewRouteInfo($field->entity_type, $bundle)) { - $usage[] = \Drupal::linkGenerator()->generateFromUrl($this->bundles[$field->entity_type][$bundle]['label'], $route_info); + foreach ($field_storage->getBundles() as $bundle) { + if ($route_info = FieldUI::getOverviewRouteInfo($field_storage->entity_type, $bundle)) { + $usage[] = \Drupal::linkGenerator()->generateFromUrl($this->bundles[$field_storage->entity_type][$bundle]['label'], $route_info); } else { - $usage[] = $this->bundles[$field->entity_type][$bundle]['label']; + $usage[] = $this->bundles[$field_storage->entity_type][$bundle]['label']; } } $usage_escaped = ''; diff --git a/core/modules/field_ui/src/Tests/EntityDisplayTest.php b/core/modules/field_ui/src/Tests/EntityDisplayTest.php index e55f5fad53e52183750eb37d1b749460f92a8849..c2ef81c06d9915d5154abe94c814e9daf88e116a 100644 --- a/core/modules/field_ui/src/Tests/EntityDisplayTest.php +++ b/core/modules/field_ui/src/Tests/EntityDisplayTest.php @@ -146,7 +146,7 @@ public function testFieldComponent() { $field_name = 'test_field'; // Create a field storage and a field. $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'test_field' )); @@ -324,7 +324,7 @@ public function testDeleteField() { $field_name = 'test_field'; // Create a field storage and a field. $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'test_field' )); @@ -373,7 +373,7 @@ public function testOnDependencyRemoval() { $field_name = 'test_field'; // Create a field. $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'text' )); diff --git a/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php b/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php index 265f881b07c01dda77591b71673da2d2d5da7adc..12b41c727ba7e0326837be2e373584b13798385d 100644 --- a/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php +++ b/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php @@ -51,7 +51,7 @@ public function testFieldComponent() { // Create a field storage and a field. $field_name = 'test_field'; $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'test_field' )); @@ -179,7 +179,7 @@ public function testDeleteField() { $field_name = 'test_field'; // Create a field storage and a field. $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'test_field' )); @@ -228,7 +228,7 @@ public function testOnDependencyRemoval() { $field_name = 'test_field'; // Create a field. $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'text' )); diff --git a/core/modules/field_ui/src/Tests/ManageFieldsTest.php b/core/modules/field_ui/src/Tests/ManageFieldsTest.php index e83e480059b42b032b491a783d2569db00fd5873..ff2139541a72d11b85d2f15c7f02c1742d4503c4 100644 --- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php +++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php @@ -41,7 +41,7 @@ protected function setUp() { $vocabulary->save(); entity_create('field_storage_config', array( - 'name' => 'field_' . $vocabulary->id(), + 'field_name' => 'field_' . $vocabulary->id(), 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', ))->save(); @@ -284,7 +284,7 @@ function testDefaultValue() { // Create a test field storage and field. $field_name = 'test'; entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'node', 'type' => 'test_field' ))->save(); @@ -411,7 +411,7 @@ function testLockedField() { // programatically as there's no way to create a locked field through UI. $field_name = strtolower($this->randomMachineName(8)); $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'node', 'type' => 'test_field', 'cardinality' => 1, @@ -423,7 +423,7 @@ function testLockedField() { 'bundle' => $this->type, ))->save(); entity_get_form_display('node', $this->type, 'default') - ->setComponent($field_storage->name, array( + ->setComponent($field_name, array( 'type' => 'test_field_widget', )) ->save(); @@ -453,7 +453,7 @@ function testHiddenFields() { // Create a field storage and a field programmatically. $field_name = 'hidden_test_field'; entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'node', 'type' => $field_name, ))->save(); @@ -550,7 +550,7 @@ function testDeleteTaxonomyField() { function testHelpDescriptions() { // Create an image field entity_create('field_storage_config', array( - 'name' => 'field_image', + 'field_name' => 'field_image', 'entity_type' => 'node', 'type' => 'image', ))->save(); diff --git a/core/modules/file/src/Tests/FileFieldTestBase.php b/core/modules/file/src/Tests/FileFieldTestBase.php index 8533a5c934a1c765996edbb75eb6e5413a0bd024..ffdfee8ca981251e97a0d08b457b43bf4a832d28 100644 --- a/core/modules/file/src/Tests/FileFieldTestBase.php +++ b/core/modules/file/src/Tests/FileFieldTestBase.php @@ -72,7 +72,7 @@ function getLastFileId() { function createFileField($name, $entity_type, $bundle, $storage_settings = array(), $field_settings = array(), $widget_settings = array()) { $field_storage = entity_create('field_storage_config', array( 'entity_type' => $entity_type, - 'name' => $name, + 'field_name' => $name, 'type' => 'file', 'settings' => $storage_settings, 'cardinality' => !empty($storage_settings['cardinality']) ? $storage_settings['cardinality'] : 1, diff --git a/core/modules/file/src/Tests/FileItemTest.php b/core/modules/file/src/Tests/FileItemTest.php index e09ecb861b6a3b005575fad0eeba1d71ddadd33a..f34d2f8066e82a14949b63e31e35e1d89638be41 100644 --- a/core/modules/file/src/Tests/FileItemTest.php +++ b/core/modules/file/src/Tests/FileItemTest.php @@ -40,7 +40,7 @@ protected function setUp() { $this->installSchema('file', array('file_usage')); entity_create('field_storage_config', array( - 'name' => 'file_test', + 'field_name' => 'file_test', 'entity_type' => 'entity_test', 'type' => 'file', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/forum/config/install/field.storage.taxonomy_term.forum_container.yml b/core/modules/forum/config/install/field.storage.taxonomy_term.forum_container.yml index a5d8164a2d79bcd27859ddb5527c1f41622ed7e6..abf4e8e4e24a79fb5cf6cc99367333e06fa850ee 100644 --- a/core/modules/forum/config/install/field.storage.taxonomy_term.forum_container.yml +++ b/core/modules/forum/config/install/field.storage.taxonomy_term.forum_container.yml @@ -1,7 +1,7 @@ id: taxonomy_term.forum_container status: true langcode: en -name: forum_container +field_name: forum_container type: boolean settings: on_label: Yes diff --git a/core/modules/forum/forum.install b/core/modules/forum/forum.install index 6af734caa03518f9d46eec42d789c44d78646336..6605c1d9f2becfc914b52687dabad4ccf9c78b0d 100644 --- a/core/modules/forum/forum.install +++ b/core/modules/forum/forum.install @@ -27,7 +27,7 @@ function forum_install() { // enabled, the field might exist but still be marked inactive. if (!FieldStorageConfig::loadByName('node', 'taxonomy_forums')) { entity_create('field_storage_config', array( - 'name' => 'taxonomy_forums', + 'field_name' => 'taxonomy_forums', 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'settings' => array( @@ -84,7 +84,7 @@ function forum_install() { // Add the comment field to the forum node type. $field_storages = entity_load_multiple_by_properties('field_storage_config', array( 'type' => 'comment', - 'name' => 'comment_forum', + 'field_name' => 'comment_forum', 'include_deleted' => FALSE, )); if (empty($field_storages)) { diff --git a/core/modules/hal/src/Tests/NormalizerTestBase.php b/core/modules/hal/src/Tests/NormalizerTestBase.php index c03167ac606e89459164329941246fcec5acbf4f..e7b59d670d2b3cff4da6c353b6384e9ece537824 100644 --- a/core/modules/hal/src/Tests/NormalizerTestBase.php +++ b/core/modules/hal/src/Tests/NormalizerTestBase.php @@ -75,7 +75,7 @@ protected function setUp() { // Create the test text field. entity_create('field_storage_config', array( - 'name' => 'field_test_text', + 'field_name' => 'field_test_text', 'entity_type' => 'entity_test', 'type' => 'text', ))->save(); @@ -88,7 +88,7 @@ protected function setUp() { // Create the test translatable field. entity_create('field_storage_config', array( - 'name' => 'field_test_translatable_text', + 'field_name' => 'field_test_translatable_text', 'entity_type' => 'entity_test', 'type' => 'text', ))->save(); @@ -101,7 +101,7 @@ protected function setUp() { // Create the test entity reference field. entity_create('field_storage_config', array( - 'name' => 'field_test_entity_reference', + 'field_name' => 'field_test_entity_reference', 'entity_type' => 'entity_test', 'type' => 'entity_reference', 'settings' => array( diff --git a/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php b/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php index 9cef633ca37f2f81a40ede365634e0dce2975adb..2c1ea0e5daa7112862fe5ab737915e041031c8ea 100644 --- a/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php +++ b/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php @@ -300,7 +300,7 @@ public function testDefaultImages() { */ public function testInvalidDefaultImage() { $field_storage = entity_create('field_storage_config', array( - 'name' => drupal_strtolower($this->randomMachineName()), + 'field_name' => drupal_strtolower($this->randomMachineName()), 'entity_type' => 'node', 'type' => 'image', 'settings' => array( diff --git a/core/modules/image/src/Tests/ImageFieldTestBase.php b/core/modules/image/src/Tests/ImageFieldTestBase.php index c566cd5f1a18edf265e8df0479217b943af1279d..33e7fc1ff503fa54a3dcc69196a0c137068f6930 100644 --- a/core/modules/image/src/Tests/ImageFieldTestBase.php +++ b/core/modules/image/src/Tests/ImageFieldTestBase.php @@ -65,7 +65,7 @@ protected function setUp() { */ function createImageField($name, $type_name, $storage_settings = array(), $field_settings = array(), $widget_settings = array()) { entity_create('field_storage_config', array( - 'name' => $name, + 'field_name' => $name, 'entity_type' => 'node', 'type' => 'image', 'settings' => $storage_settings, diff --git a/core/modules/image/src/Tests/ImageItemTest.php b/core/modules/image/src/Tests/ImageItemTest.php index 9e1ed5bfc8b1fd4fab350a433d46b96ec8d06b9b..e0a3b3678cef37ca571a0616514371ab99354a0f 100644 --- a/core/modules/image/src/Tests/ImageItemTest.php +++ b/core/modules/image/src/Tests/ImageItemTest.php @@ -45,8 +45,8 @@ protected function setUp() { $this->installSchema('file', array('file_usage')); entity_create('field_storage_config', array( - 'name' => 'image_test', 'entity_type' => 'entity_test', + 'field_name' => 'image_test', 'type' => 'image', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, ))->save(); diff --git a/core/modules/image/src/Tests/ImageThemeFunctionTest.php b/core/modules/image/src/Tests/ImageThemeFunctionTest.php index 700e96da0566e94b86e009653b8948ded538c162..43a6338621bf6ac28608b08e1d6411f1eb22ee3f 100644 --- a/core/modules/image/src/Tests/ImageThemeFunctionTest.php +++ b/core/modules/image/src/Tests/ImageThemeFunctionTest.php @@ -40,8 +40,8 @@ protected function setUp() { parent::setUp(); entity_create('field_storage_config', array( - 'name' => 'image_test', 'entity_type' => 'entity_test', + 'field_name' => 'image_test', 'type' => 'image', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, ))->save(); diff --git a/core/modules/link/src/Tests/LinkFieldTest.php b/core/modules/link/src/Tests/LinkFieldTest.php index c596c53a7a40de32ee8653cc43800de4dd7388c1..a508c0cac01585328a8d5306a7d2f6c116399022 100644 --- a/core/modules/link/src/Tests/LinkFieldTest.php +++ b/core/modules/link/src/Tests/LinkFieldTest.php @@ -64,7 +64,7 @@ function testURLValidation() { $field_name = drupal_strtolower($this->randomMachineName()); // Create a field with settings to validate. $this->fieldStorage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'link', )); @@ -184,7 +184,7 @@ function testLinkTitle() { $field_name = drupal_strtolower($this->randomMachineName()); // Create a field with settings to validate. $this->fieldStorage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'link', )); @@ -298,7 +298,7 @@ function testLinkFormatter() { $field_name = drupal_strtolower($this->randomMachineName()); // Create a field with settings to validate. $this->fieldStorage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'link', 'cardinality' => 2, @@ -438,7 +438,7 @@ function testLinkSeparateFormatter() { $field_name = drupal_strtolower($this->randomMachineName()); // Create a field with settings to validate. $this->fieldStorage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'link', 'cardinality' => 2, diff --git a/core/modules/link/src/Tests/LinkItemTest.php b/core/modules/link/src/Tests/LinkItemTest.php index e97dc526d2485caa2fc7f20b34ce9d08011364a3..468ef9fc0996a44ce36e446cb2c1b145d2baf5fa 100644 --- a/core/modules/link/src/Tests/LinkItemTest.php +++ b/core/modules/link/src/Tests/LinkItemTest.php @@ -31,7 +31,7 @@ protected function setUp() { // Create a link field for validation. entity_create('field_storage_config', array( - 'name' => 'field_test', + 'field_name' => 'field_test', 'entity_type' => 'entity_test', 'type' => 'link', ))->save(); diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php index 0e5829f2ccd13b3abf44bc4afb2663a0af9d2fd3..9d1eba3f1b232f476f80527306b93bea726fa482 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityFieldStorageConfig.php @@ -19,7 +19,7 @@ class EntityFieldStorageConfig extends EntityConfigBase { */ public function getIds() { $ids['entity_type']['type'] = 'string'; - $ids['name']['type'] = 'string'; + $ids['field_name']['type'] = 'string'; return $ids; } diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_comment_field.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_comment_field.yml index 6a6578a52653dc5332380c1258b11298508508a8..02cf1fab16158c1174673677575e7702aceef8ad 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_comment_field.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_comment_field.yml @@ -9,7 +9,7 @@ source: type: comment process: entity_type: 'constants/entity_type' - name: comment_type + field_name: comment_type type: 'constants/type' 'settings/comment_type': comment_type destination: diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_field.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_field.yml index 8d4f723041a8deefdbf96e10ae81a59c7f19add6..72ae39bde19ef8a2c6040af39d5b0138a84397cf 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_field.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_field.yml @@ -11,7 +11,7 @@ process: entity_type: 'constants/entity_type' status: active langcode: 'constants/langcode' - name: field_name + field_name: field_name type: - plugin: static_map diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_upload_field.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_upload_field.yml index 8daaa4a41a911617f61e29b70fcb5730759c3385..be18ea25bae1ec6964b90169e5e40d08b8abb266 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_upload_field.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_upload_field.yml @@ -15,7 +15,7 @@ source: display_field: true process: entity_type: 'constants/entity_type' - name: 'constants/name' + field_name: 'constants/name' type: 'constants/type' cardinality: 'constants/cardinality' 'settings/display_field': 'constants/display_field' diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_picture_field.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_picture_field.yml index 502bf0debe8075d53926eb04922805374653d8e6..f5796e6e7d09e809db4b4052600dbc18fd35098a 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_picture_field.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_picture_field.yml @@ -13,7 +13,7 @@ source: cardinality: 1 process: entity_type: 'constants/entity_type' - name: 'constants/name' + field_name: 'constants/name' type: 'constants/type' cardinality: 'constants/cardinality' destination: diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_profile_field.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_profile_field.yml index add4d5122233d4d0d37b89191e20f83b342baaf0..5e46885e6cfe7ad15f1549e9a4189451ef1c36b5 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_profile_field.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_user_profile_field.yml @@ -8,7 +8,7 @@ source: entity_type: user process: entity_type: 'constants/entity_type' - name: name + field_name: name type: plugin: static_map source: type diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_vocabulary_field.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_vocabulary_field.yml index 9d5e82de565d9219acb46ba37729fea8da070efb..a833cbd0a2af378a6b9df46caac4c51eba7516ea 100644 --- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_vocabulary_field.yml +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_vocabulary_field.yml @@ -12,11 +12,11 @@ source: process: entity_type: 'constants/entity_type' type: 'constants/type' - name: + field_name: plugin: migration migration: d6_taxonomy_vocabulary source: vid - 'settings/allowed_values/0/vocabulary': @name + 'settings/allowed_values/0/vocabulary': @field_name 'settings/allowed_values/0/parent': 'constants/parent' cardinality: 'constants/cardinality' destination: diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldRevisionTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldRevisionTest.php index 39917a2d6faa5e9ed1f89d5c75c2dc9070ce3d65..47f6928f59860fe6a3bb6c27de7871624337c910 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldRevisionTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldRevisionTest.php @@ -30,7 +30,7 @@ protected function setUp() { parent::setUp(); entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'field_test', + 'field_name' => 'field_test', 'type' => 'text', ))->save(); entity_create('field_config', array( @@ -40,7 +40,7 @@ protected function setUp() { ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'field_test_two', + 'field_name' => 'field_test_two', 'type' => 'integer', 'cardinality' => -1, ))->save(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php index c97afe37f976e9b13cf437911867c947b065b245..13bf404d3b68587fdf24515cbeb599831a7745dd 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php @@ -31,7 +31,7 @@ protected function setUp() { parent::setUp(); entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'field_test', + 'field_name' => 'field_test', 'type' => 'text', ))->save(); entity_create('field_config', array( @@ -41,7 +41,7 @@ protected function setUp() { ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'field_test_two', + 'field_name' => 'field_test_two', 'type' => 'integer', 'cardinality' => -1, ))->save(); @@ -52,7 +52,7 @@ protected function setUp() { ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'field_test_three', + 'field_name' => 'field_test_three', 'type' => 'decimal', ))->save(); entity_create('field_config', array( @@ -62,7 +62,7 @@ protected function setUp() { ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'field_test_integer_selectlist', + 'field_name' => 'field_test_integer_selectlist', 'type' => 'integer', ))->save(); entity_create('field_config', array( @@ -73,7 +73,7 @@ protected function setUp() { entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'field_multivalue', + 'field_name' => 'field_multivalue', 'type' => 'integer', 'cardinality' => -1, ))->save(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php index 58765c8eff2c10709f7dca8032ed5d149de6a393..eb28daa7c58e3eb3c61214fdd0478c8aec0a64a6 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php @@ -51,7 +51,7 @@ protected function setUp() { parent::setUp(); entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'comment', + 'field_name' => 'comment', 'type' => 'comment', 'translatable' => '0', ))->save(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php index 67085bed215a67790b98258921f3adb74530a124..c6e369a0d2b9bae371cb0bfecbbcc65366d6b4f4 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php @@ -40,15 +40,15 @@ protected function setUp() { } entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'comment', - 'type' => 'comment', - 'translatable' => '0', + 'field_name' => 'comment', + 'type' => 'comment', + 'translatable' => '0', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'comment_no_subject', - 'type' => 'comment', - 'translatable' => '0', + 'field_name' => 'comment_no_subject', + 'type' => 'comment', + 'translatable' => '0', ))->save(); /** @var \Drupal\migrate\entity\Migration $migration */ $migration = entity_load('migration', 'd6_comment_field_instance'); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php index 2b50623ea52b0f1dc3ef8ebfe49b0077d33d70ec..3fde79b41b7677c8dfd146f85ec621310aec9d43 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php @@ -166,7 +166,7 @@ protected function createFields() { ); foreach ($fields as $name => $type) { entity_create('field_storage_config', array( - 'name' => $name, + 'field_name' => $name, 'entity_type' => 'node', 'type' => $type, ))->save(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateProfileValuesTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateProfileValuesTest.php index 680604bb462ca3e213ec9efea83fbd730b453358..00dbce165c7ab3f675713fdfacb628e72a8872a6 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateProfileValuesTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateProfileValuesTest.php @@ -42,22 +42,22 @@ protected function setUp() { // Create some fields so the data gets stored. entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_color', + 'field_name' => 'profile_color', 'type' => 'text', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_biography', + 'field_name' => 'profile_biography', 'type' => 'text_long', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_sell_address', + 'field_name' => 'profile_sell_address', 'type' => 'boolean', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_sold_to', + 'field_name' => 'profile_sold_to', 'type' => 'list_string', 'settings' => array( 'allowed_values' => array( @@ -68,23 +68,23 @@ protected function setUp() { ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_bands', + 'field_name' => 'profile_bands', 'type' => 'text', 'cardinality' => -1, ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_blog', + 'field_name' => 'profile_blog', 'type' => 'link', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_birthdate', + 'field_name' => 'profile_birthdate', 'type' => 'datetime', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_love_migrations', + 'field_name' => 'profile_love_migrations', 'type' => 'boolean', ))->save(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeTestBase.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeTestBase.php index fb14c7dbe26da1a49f3070d2d5cada5832878491..74045512415ec535c37628320bc0333354f0e763 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeTestBase.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTermNodeTestBase.php @@ -32,7 +32,7 @@ protected function setUp() { $node_type->save(); foreach (array('vocabulary_1_i_0_', 'vocabulary_2_i_1_', 'vocabulary_3_i_2_') as $name) { entity_create('field_storage_config', array( - 'name' => $name, + 'field_name' => $name, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'cardinality' => -1, diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadBase.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadBase.php index d411a1118df76e5c53d06ec6047bece2aa0678fd..5612c171531be5379a84d24b39056b85ba63fd66 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadBase.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadBase.php @@ -50,7 +50,7 @@ protected function setUp() { // Add a file field. entity_create('field_storage_config', array( - 'name' => 'upload', + 'field_name' => 'upload', 'entity_type' => 'node', 'type' => 'file', 'cardinality' => -1, diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php index 89fea7dde534c14e19b9775d4debdd36255fc588..8df7b9cfc11d6d11576a42299f6e96e565df7604 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUploadInstanceTest.php @@ -46,7 +46,7 @@ protected function setUp() { } entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'upload', + 'field_name' => 'upload', 'type' => 'file', 'translatable' => '0', ))->save(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php index 6fb4886fb9bd24060028e328a31b93e197534e72..4015c4ef52b907237bc67667e804700c09f437fa 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserPictureInstanceTest.php @@ -38,7 +38,7 @@ protected function setUp() { $this->prepareMigrations($id_mappings); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'user_picture', + 'field_name' => 'user_picture', 'type' => 'image', 'translatable' => '0', ))->save(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php index 6d51782bec2653ab4cff8ec63c42e9b1ce691a1c..aded50fb2d0f5bd886de647ce7cbc96218fb3ec2 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityDisplayTest.php @@ -34,43 +34,43 @@ protected function setUp() { // Create some fields so the data gets stored. entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_color', + 'field_name' => 'profile_color', 'type' => 'text', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_biography', + 'field_name' => 'profile_biography', 'type' => 'text_long', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_sell_address', + 'field_name' => 'profile_sell_address', 'type' => 'boolean', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_sold_to', + 'field_name' => 'profile_sold_to', 'type' => 'list_string', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_bands', + 'field_name' => 'profile_bands', 'type' => 'text', 'cardinality' => -1, ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_blog', + 'field_name' => 'profile_blog', 'type' => 'link', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_birthdate', + 'field_name' => 'profile_birthdate', 'type' => 'datetime', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_love_migrations', + 'field_name' => 'profile_love_migrations', 'type' => 'boolean', ))->save(); $field_data = Drupal6UserProfileFields::getData('profile_fields'); @@ -93,7 +93,6 @@ protected function setUp() { $this->prepare($migration, $dumps); $executable = new MigrateExecutable($migration, $this); $executable->import(); - } /** diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php index 2abf4aa0e395449fb5a24887f80052fb5e7bbbba..627c8d9e99ee2348cc9d0720ae4671c1ac4695ad 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileEntityFormDisplayTest.php @@ -29,43 +29,43 @@ protected function setUp() { // Create some fields so the data gets stored. entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_color', + 'field_name' => 'profile_color', 'type' => 'text', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_biography', + 'field_name' => 'profile_biography', 'type' => 'text_long', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_sell_address', + 'field_name' => 'profile_sell_address', 'type' => 'boolean', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_sold_to', + 'field_name' => 'profile_sold_to', 'type' => 'list_string', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_bands', + 'field_name' => 'profile_bands', 'type' => 'text', 'cardinality' => -1, ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_blog', + 'field_name' => 'profile_blog', 'type' => 'link', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_birthdate', + 'field_name' => 'profile_birthdate', 'type' => 'datetime', ))->save(); entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'profile_love_migrations', + 'field_name' => 'profile_love_migrations', 'type' => 'boolean', ))->save(); $field_data = Drupal6UserProfileFields::getData('profile_fields'); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php index dfa00ed6864fd917db434496b313c4d353a71bb9..73643bcd32a0464d8e11afd4c78ac132ad4ef7ed 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldInstanceTest.php @@ -107,7 +107,7 @@ protected function createFields() { ); foreach ($fields as $name => $type) { entity_create('field_storage_config', array( - 'name' => $name, + 'field_name' => $name, 'entity_type' => 'user', 'type' => $type, ))->save(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php index 53c7bdfcb02071a7e1308cfa0574ce1d785a4a4d..82f60f03a4c14e61d09bfa1d9254ecc79d17db9d 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php @@ -40,7 +40,7 @@ protected function setUp() { // Create the user profile field and instance. entity_create('field_storage_config', array( 'entity_type' => 'user', - 'name' => 'user_picture', + 'field_name' => 'user_picture', 'type' => 'image', 'translatable' => '0', ))->save(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php index 39486946876226463ca525774b51d2b846ee5aa1..bdb849c3065104d02d710b099c0e36a6bbc59d00 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityDisplayTest.php @@ -32,7 +32,7 @@ protected function setUp() { entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'tags', + 'field_name' => 'tags', 'type' => 'taxonomy_term_reference', ))->save(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php index 7fdd95f8054827ddba7c2c3c7532a52562fc8ccb..31759aacf337a88be96985422fbb7c34164e60cf 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyEntityFormDisplayTest.php @@ -32,7 +32,7 @@ protected function setUp() { entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'tags', + 'field_name' => 'tags', 'type' => 'taxonomy_term_reference', ))->save(); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php index 1ee83bb544a4c585522efaf8054942bde038aad5..eb2353a2daeb486974268e4fd091b7f3be15b06b 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldInstanceTest.php @@ -48,14 +48,14 @@ protected function setUp() { // Create the vocab. entity_create('taxonomy_vocabulary', array( - 'name' => 'Test Vocabulary', + 'field_name' => 'Test Vocabulary', 'description' => 'Test Vocabulary', 'vid' => 'tags', ))->save(); - // Create the field itself. + // Create the field storage. entity_create('field_storage_config', array( 'entity_type' => 'node', - 'name' => 'tags', + 'field_name' => 'tags', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, 'settings' => array( diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php index f1e1d5f12450e8672921aa005ededfd588acdab1..1d261c38d2dece0cccaa8614a820c2e3b81a5c38 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateVocabularyFieldTest.php @@ -57,14 +57,13 @@ protected function setUp() { * Tests the Drupal 6 vocabulary-node type association to Drupal 8 migration. */ public function testVocabularyField() { - // Test that the field exists. + // Test that the field exists. $field_storage_id = 'node.tags'; $field_storage = entity_load('field_storage_config', $field_storage_id); $this->assertEqual($field_storage->id(), $field_storage_id); $settings = $field_storage->getSettings(); $this->assertEqual('tags', $settings['allowed_values'][0]['vocabulary'], "Vocabulary has correct settings."); $this->assertEqual(array('node', 'tags'), entity_load('migration', 'd6_vocabulary_field')->getIdMap()->lookupDestinationID(array(4)), "Test IdMap"); - } } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index c22e92ee4c4ac33f44fc24f5755947795bbee6a0..c51640cf3c3ca0e4992ea0636b8a65e3d2cc1f3b 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -335,7 +335,7 @@ function node_add_body_field(NodeTypeInterface $type, $label = 'Body') { $field = FieldConfig::loadByName('node', $type->id(), 'body'); if (empty($field_storage)) { $field_storage = entity_create('field_storage_config', array( - 'name' => 'body', + 'field_name' => 'body', 'entity_type' => 'node', 'type' => 'text_with_summary', )); diff --git a/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php b/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php index 2d651173a58946cfc33dfaa751ed22d779d69c0e..38a06dd8962e522ed5332c4f56d0efd3b24c0e88 100644 --- a/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php +++ b/core/modules/node/src/Tests/MultiStepNodeFormBasicOptionsTest.php @@ -32,7 +32,7 @@ function testMultiStepNodeFormBasicOptions() { // Create an unlimited cardinality field. $this->field_name = drupal_strtolower($this->randomMachineName()); entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'node', 'type' => 'text', 'cardinality' => -1, diff --git a/core/modules/node/src/Tests/NodeAccessFieldTest.php b/core/modules/node/src/Tests/NodeAccessFieldTest.php index d31391ec81d7166ce02660e8543b6d5c5d10407e..709ba29c8eada1e8280c772c92b87b835af72e08 100644 --- a/core/modules/node/src/Tests/NodeAccessFieldTest.php +++ b/core/modules/node/src/Tests/NodeAccessFieldTest.php @@ -54,7 +54,7 @@ protected function setUp() { // Add a custom field to the page content type. $this->field_name = drupal_strtolower($this->randomMachineName() . '_field_name'); entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'node', 'type' => 'text' ))->save(); diff --git a/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php b/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php index 24028f47b6978425759e0903bfb67cd638632513..f73ac3b16f5674fe58d60333d6e0bc177a546cc1 100644 --- a/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php +++ b/core/modules/node/src/Tests/NodeAccessLanguageAwareCombinationTest.php @@ -54,7 +54,7 @@ protected function setUp() { // Create the 'private' field, which allows the node to be marked as private // (restricted access) in a given translation. $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_private', + 'field_name' => 'field_private', 'entity_type' => 'node', 'type' => 'boolean', 'cardinality' => 1, diff --git a/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php b/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php index 701a2d9fe0db946df958b024afddfbc5cc32f696..ad82deabdd9e113e92e08134f77fe25581bf8452 100644 --- a/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php +++ b/core/modules/node/src/Tests/NodeAccessLanguageAwareTest.php @@ -45,7 +45,7 @@ protected function setUp() { // Create the 'private' field, which allows the node to be marked as private // (restricted access) in a given translation. $field_storage = entity_create('field_storage_config', array( - 'name' => 'field_private', + 'field_name' => 'field_private', 'entity_type' => 'node', 'type' => 'boolean', 'cardinality' => 1, diff --git a/core/modules/node/src/Tests/PagePreviewTest.php b/core/modules/node/src/Tests/PagePreviewTest.php index 138db9189ea8c838b3424e7997f8cfb3ac517b87..0a78f7623c1d04b397a5b3882ae4bf43479686b2 100644 --- a/core/modules/node/src/Tests/PagePreviewTest.php +++ b/core/modules/node/src/Tests/PagePreviewTest.php @@ -63,7 +63,7 @@ protected function setUp() { // Create a field. $this->field_name = drupal_strtolower($this->randomMachineName()); entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'settings' => array( diff --git a/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php b/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php index 62f4034ecf59c0b8eb9064d0a72ab5de3e313adc..599b1269b7522e1c1ae2cea9647ce411e0c3f6dc 100644 --- a/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php +++ b/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php @@ -50,9 +50,9 @@ function setUp() { // Make the body field translatable. The title is already translatable by // definition. - $field = FieldStorageConfig::loadByName('node', 'body'); - $field->translatable = TRUE; - $field->save(); + $field_storage = FieldStorageConfig::loadByName('node', 'body'); + $field_storage->translatable = TRUE; + $field_storage->save(); // Set up node titles. $this->node_titles = array( diff --git a/core/modules/node/src/Tests/Views/NodeLanguageTest.php b/core/modules/node/src/Tests/Views/NodeLanguageTest.php index 290d9d8eb028f3df8e1a0367b61dfce5d68b0d60..3450f26d76256cbbe4865ff15349a643c425eb21 100644 --- a/core/modules/node/src/Tests/Views/NodeLanguageTest.php +++ b/core/modules/node/src/Tests/Views/NodeLanguageTest.php @@ -53,9 +53,9 @@ protected function setUp() { // Make the body field translatable. The title is already translatable by // definition. - $field = FieldStorageConfig::loadByName('node', 'body'); - $field->translatable = TRUE; - $field->save(); + $field_storage = FieldStorageConfig::loadByName('node', 'body'); + $field_storage->translatable = TRUE; + $field_storage->save(); // Set up node titles. They should not include the words "French", // "English", or "Spanish", as there is a language field in the view diff --git a/core/modules/node/tests/modules/node_access_test/node_access_test.module b/core/modules/node/tests/modules/node_access_test/node_access_test.module index 8cc226e22190af06bbd8c592654a2e7cae073c3c..b44117ecdd0c0927aad6c2a7e4f59ad7185b9e2e 100644 --- a/core/modules/node/tests/modules/node_access_test/node_access_test.module +++ b/core/modules/node/tests/modules/node_access_test/node_access_test.module @@ -120,7 +120,7 @@ function node_access_test_node_access_records(NodeInterface $node) { */ function node_access_test_add_field(NodeTypeInterface $type) { $field_storage = FieldStorageConfig::create(array( - 'name' => 'private', + 'field_name' => 'private', 'entity_type' => 'node', 'type' => 'integer', )); diff --git a/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php b/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php index d6f958f9214f71f70a14a71b2b9b33309969d7f6..43d0bc988231c44674e6e13d94e3662d7ea32405 100644 --- a/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php +++ b/core/modules/options/src/Tests/OptionsDynamicValuesTestBase.php @@ -33,7 +33,7 @@ protected function setUp() { $this->field_name = 'test_options'; entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'entity_test_rev', 'type' => 'list_string', 'cardinality' => 1, diff --git a/core/modules/options/src/Tests/OptionsFieldUITest.php b/core/modules/options/src/Tests/OptionsFieldUITest.php index fe2f45bfd35a0066a82503d1b32d141dc472748a..e3b46848297948722a083b4b7a3ce3d4fe1bfa45 100644 --- a/core/modules/options/src/Tests/OptionsFieldUITest.php +++ b/core/modules/options/src/Tests/OptionsFieldUITest.php @@ -248,7 +248,7 @@ function testOptionsTrimmedValuesText() { protected function createOptionsField($type) { // Create a field. entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'node', 'type' => $type, ))->save(); diff --git a/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php b/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php index c80d1376bab662f05e149a4da9597fe36cf3a171..d71a15276b3d9dd081d5d432e695e4b517d11cd5 100644 --- a/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php +++ b/core/modules/options/src/Tests/OptionsFieldUnitTestBase.php @@ -58,7 +58,7 @@ protected function setUp() { $this->installSchema('system', array('router')); $this->fieldStorageDefinition = array( - 'name' => $this->fieldName, + 'field_name' => $this->fieldName, 'entity_type' => 'entity_test', 'type' => 'list_integer', 'cardinality' => 1, diff --git a/core/modules/options/src/Tests/OptionsWidgetsTest.php b/core/modules/options/src/Tests/OptionsWidgetsTest.php index 35ced84fbf8b17ef6d4605ef52058420e4a59b2a..e1e52fe0aa7d8f1f1de4a4498a804227362d85f2 100644 --- a/core/modules/options/src/Tests/OptionsWidgetsTest.php +++ b/core/modules/options/src/Tests/OptionsWidgetsTest.php @@ -50,7 +50,7 @@ protected function setUp() { // Field storage with cardinality 1. $this->card_1 = entity_create('field_storage_config', array( - 'name' => 'card_1', + 'field_name' => 'card_1', 'entity_type' => 'entity_test', 'type' => 'list_integer', 'cardinality' => 1, @@ -70,7 +70,7 @@ protected function setUp() { // Field storage with cardinality 2. $this->card_2 = entity_create('field_storage_config', array( - 'name' => 'card_2', + 'field_name' => 'card_2', 'entity_type' => 'entity_test', 'type' => 'list_integer', 'cardinality' => 2, diff --git a/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php b/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php index 7241ccf4388b96036402d8de3ae87f6b50c9da54..9a8eb5d3e2f70ca56545867053fba5b0237ec7d1 100644 --- a/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php +++ b/core/modules/quickedit/src/Tests/QuickEditAutocompleteTermTest.php @@ -75,7 +75,7 @@ protected function setUp() { $this->vocabulary->save(); $this->field_name = 'field_' . $this->vocabulary->id(); entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', // Set cardinality to unlimited for tagging. diff --git a/core/modules/quickedit/src/Tests/QuickEditTestBase.php b/core/modules/quickedit/src/Tests/QuickEditTestBase.php index bfd4fa90b02e27a5e244d88633adffe8d9163463..a9e803836d9b8de099ff39a51b9f99f851393d4e 100644 --- a/core/modules/quickedit/src/Tests/QuickEditTestBase.php +++ b/core/modules/quickedit/src/Tests/QuickEditTestBase.php @@ -71,7 +71,7 @@ protected function setUp() { protected function createFieldWithStorage($field_name, $type, $cardinality, $label, $field_settings, $widget_type, $widget_settings, $formatter_type, $formatter_settings) { $field_storage = $field_name . '_field_storage'; $this->fields->$field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => $type, 'cardinality' => $cardinality, diff --git a/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php b/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php index 23f5be6f59f910c8ce2bb04de5d5904a7cfb5aa2..adddda12dea683c732f293a403f50819f4fb2bfd 100644 --- a/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php +++ b/core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php @@ -116,7 +116,7 @@ protected function assertFormatterRdfa($formatter, $property, $expected_rdf_valu */ protected function createTestField($field_settings = array()) { entity_create('field_storage_config', array( - 'name' => $this->fieldName, + 'field_name' => $this->fieldName, 'entity_type' => 'entity_test', 'type' => $this->fieldType, ))->save(); diff --git a/core/modules/rdf/src/Tests/Field/TaxonomyTermReferenceRdfaTest.php b/core/modules/rdf/src/Tests/Field/TaxonomyTermReferenceRdfaTest.php index a22376d65a42d9efc9997640c077c087da5e706a..d6e586de434a48adbaf65112653e1d9892fe231c 100644 --- a/core/modules/rdf/src/Tests/Field/TaxonomyTermReferenceRdfaTest.php +++ b/core/modules/rdf/src/Tests/Field/TaxonomyTermReferenceRdfaTest.php @@ -54,7 +54,7 @@ protected function setUp() { $vocabulary->save(); entity_create('field_storage_config', array( - 'name' => $this->fieldName, + 'field_name' => $this->fieldName, 'entity_type' => 'entity_test', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/rdf/src/Tests/TaxonomyTermFieldAttributesTest.php b/core/modules/rdf/src/Tests/TaxonomyTermFieldAttributesTest.php index cb51ec2a3a7e4fcbcf791c1fd27356e64ce3ee7e..5e698c2140a5a7fe67cfc1aa70d321a7fc170bd2 100644 --- a/core/modules/rdf/src/Tests/TaxonomyTermFieldAttributesTest.php +++ b/core/modules/rdf/src/Tests/TaxonomyTermFieldAttributesTest.php @@ -148,7 +148,7 @@ function testNodeTeaser() { */ protected function createTaxonomyTermReferenceField($field_name, $vocabulary) { entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/serialization/src/Tests/EntityResolverTest.php b/core/modules/serialization/src/Tests/EntityResolverTest.php index 26237b77f99e4f7c1a5e468a81a382c001574a57..3cf89528d032044f9363f8355bac65c6498b6910 100644 --- a/core/modules/serialization/src/Tests/EntityResolverTest.php +++ b/core/modules/serialization/src/Tests/EntityResolverTest.php @@ -32,12 +32,12 @@ protected function setUp() { // Create the test field storage. entity_create('field_storage_config', array( + 'entity_type' => 'entity_test_mulrev', + 'field_name' => 'field_test_entity_reference', + 'type' => 'entity_reference', 'settings' => array( 'target_type' => 'entity_test_mulrev', ), - 'name' => 'field_test_entity_reference', - 'entity_type' => 'entity_test_mulrev', - 'type' => 'entity_reference', ))->save(); // Create the test field. diff --git a/core/modules/serialization/src/Tests/NormalizerTestBase.php b/core/modules/serialization/src/Tests/NormalizerTestBase.php index 531c53db47384d2f201fdabc37edd85da0d7c14b..3eab599af233518beb33893827e73c8b9378af64 100644 --- a/core/modules/serialization/src/Tests/NormalizerTestBase.php +++ b/core/modules/serialization/src/Tests/NormalizerTestBase.php @@ -28,8 +28,8 @@ protected function setUp() { // Auto-create a field for testing. entity_create('field_storage_config', array( - 'name' => 'field_test_text', 'entity_type' => 'entity_test_mulrev', + 'field_name' => 'field_test_text', 'type' => 'text', 'cardinality' => 1, 'translatable' => FALSE, diff --git a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php index 2b5c4c6e86ca912a4a126ca9a28c3f48c0878508..6e2d21624b4c98b2da2fb4093322282c0b34e6d6 100644 --- a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php +++ b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php @@ -252,7 +252,7 @@ function testEnableModulesFixedList() { 'mode' => 'default', )); $field_storage = entity_create('field_storage_config', array( - 'name' => 'test_field', + 'field_name' => 'test_field', 'entity_type' => 'entity_test', 'type' => 'test_field' )); diff --git a/core/modules/system/src/Tests/Ajax/MultiFormTest.php b/core/modules/system/src/Tests/Ajax/MultiFormTest.php index 6d14123f2a851f1dc7ed9f8544d9f463655c5fa9..37251c6fac353c33fd24aa3dd322cd357b283891 100644 --- a/core/modules/system/src/Tests/Ajax/MultiFormTest.php +++ b/core/modules/system/src/Tests/Ajax/MultiFormTest.php @@ -32,8 +32,8 @@ protected function setUp() { // Create a multi-valued field for 'page' nodes to use for Ajax testing. $field_name = 'field_ajax_test'; entity_create('field_storage_config', array( - 'name' => $field_name, 'entity_type' => 'node', + 'field_name' => $field_name, 'type' => 'text', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, ))->save(); diff --git a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php index aeaf266a0433481b486b14e4c03378fde7cfa680..b7299a5c5ada29e6918f7be98b64b361af2b1428 100644 --- a/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php +++ b/core/modules/system/src/Tests/Entity/EntityCacheTagsTestBase.php @@ -67,7 +67,7 @@ protected function setUp() { // Add field, so we can modify the Field and Field entities to // verify that changes to those indeed clear cache tags. entity_create('field_storage_config', array( - 'name' => 'configurable_field', + 'field_name' => 'configurable_field', 'entity_type' => $this->entity->getEntityTypeId(), 'type' => 'test_field', 'settings' => array(), @@ -183,7 +183,7 @@ protected function createReferenceTestEntities($referenced_entity) { // Add a field of the given type to the given entity type's "foo" bundle. $field_name = $referenced_entity->getEntityTypeId() . '_reference'; entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => $entity_type, 'type' => 'entity_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php b/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php index 4a01c21a49d10390ae2a8dc215259e08413b94c0..ca5d29e53403e8eae756d7886c5a338587eebbd8 100644 --- a/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php +++ b/core/modules/system/src/Tests/Entity/EntityLanguageTestBase.php @@ -71,7 +71,7 @@ protected function setUp() { // Create field fields in all entity variations. foreach (entity_test_entity_types() as $entity_type) { entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => $entity_type, 'type' => 'text', 'cardinality' => 4, @@ -85,7 +85,7 @@ protected function setUp() { $this->field[$entity_type] = entity_load('field_config', $entity_type . '.' . $entity_type . '.' . $this->field_name); entity_create('field_storage_config', array( - 'name' => $this->untranslatable_field_name, + 'field_name' => $this->untranslatable_field_name, 'entity_type' => $entity_type, 'type' => 'text', 'cardinality' => 4, diff --git a/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php b/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php index 08665b95740b8dfa340771b753e1697786875e35..1df6c88d6ccd1b969e16754af7b7db6938072f79 100644 --- a/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php +++ b/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php @@ -52,7 +52,7 @@ protected function setUp() { for ($i = 1; $i <= 2; $i++) { $field_name = 'field_test_' . $i; entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'integer', 'cardinality' => 2, diff --git a/core/modules/system/src/Tests/Entity/EntityQueryRelationshipTest.php b/core/modules/system/src/Tests/Entity/EntityQueryRelationshipTest.php index ac2362e65aa1d5aee19c5866b446f9a197367521..e102562c9503e667e69cfc7d5ba22430dd9b14eb 100644 --- a/core/modules/system/src/Tests/Entity/EntityQueryRelationshipTest.php +++ b/core/modules/system/src/Tests/Entity/EntityQueryRelationshipTest.php @@ -74,13 +74,16 @@ protected function setUp() { $vocabulary->save(); // Second, create the field. $this->fieldName = strtolower($this->randomMachineName()); - $field = array( - 'name' => $this->fieldName, + entity_create('field_storage_config', array( + 'field_name' => $this->fieldName, 'entity_type' => 'entity_test', 'type' => 'taxonomy_term_reference', - ); - $field['settings']['allowed_values']['vocabulary'] = $vocabulary->id(); - entity_create('field_storage_config', $field)->save(); + 'settings' => array( + 'allowed_values' => array( + 'vocabulary' => $vocabulary->id(), + ), + ), + ))->save(); entity_test_create_bundle('test_bundle'); // Third, create the instance. entity_create('field_config', array( diff --git a/core/modules/system/src/Tests/Entity/EntityQueryTest.php b/core/modules/system/src/Tests/Entity/EntityQueryTest.php index b639f0d4f936e857ab9c0fc714bc1b1cf9470997..d045cb38471e5d767d94b48d9ce66986d2c30217 100644 --- a/core/modules/system/src/Tests/Entity/EntityQueryTest.php +++ b/core/modules/system/src/Tests/Entity/EntityQueryTest.php @@ -60,7 +60,7 @@ protected function setUp() { $greetings = drupal_strtolower($this->randomMachineName()); foreach (array($figures => 'shape', $greetings => 'text') as $field_name => $field_type) { $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test_mulrev', 'type' => $field_type, 'cardinality' => 2, @@ -413,7 +413,7 @@ public function testCount() { // Create a field with the same name in a different entity type. $field_name = $this->figures; $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'shape', 'cardinality' => 2, diff --git a/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php b/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php index c4cdeb1c0153e0b3462a5271ce7f89104b31d695..037d7077521b0ae9c04865763d5bddac85ca0df5 100644 --- a/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php +++ b/core/modules/system/src/Tests/Entity/FieldSqlStorageTest.php @@ -84,7 +84,7 @@ protected function setUp() { $this->field_name = strtolower($this->randomMachineName()); $this->field_cardinality = 4; $this->fieldStorage = entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => $entity_type, 'type' => 'test_field', 'cardinality' => $this->field_cardinality, @@ -282,7 +282,7 @@ function testLongNames() { for ($i = 0; $i < 2; $i++) { $field_names[$i] = $name_base . $i; entity_create('field_storage_config', array( - 'name' => $field_names[$i], + 'field_name' => $field_names[$i], 'entity_type' => $entity_type, 'type' => 'test_field', ))->save(); @@ -312,7 +312,7 @@ function testUpdateFieldSchemaWithData() { $entity_type = 'entity_test_rev'; // Create a decimal 5.2 field and add some data. $field_storage = entity_create('field_storage_config', array( - 'name' => 'decimal52', + 'field_name' => 'decimal52', 'entity_type' => $entity_type, 'type' => 'decimal', 'settings' => array('precision' => 5, 'scale' => 2), @@ -347,7 +347,7 @@ function testUpdateFieldSchemaWithData() { function testFieldUpdateFailure() { // Create a text field. $field_storage = entity_create('field_storage_config', array( - 'name' => 'test_text', + 'field_name' => 'test_text', 'entity_type' => 'entity_test_rev', 'type' => 'text', 'settings' => array('max_length' => 255), @@ -383,7 +383,7 @@ function testFieldUpdateIndexesWithData() { $field_name = 'testfield'; $entity_type = 'entity_test_rev'; $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => $entity_type, 'type' => 'text', )); @@ -439,7 +439,7 @@ function testFieldSqlStorageForeignKeys() { $field_name = 'testfield'; $foreign_key_name = 'shape'; $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'shape', 'settings' => array('foreign_key_name' => $foreign_key_name), @@ -469,12 +469,13 @@ function testFieldSqlStorageForeignKeys() { */ function testFieldSqlStorageBundleRename() { $entity_type = $bundle = 'entity_test_rev'; + $field_name = $this->fieldStorage->getName(); // Create an entity. $value = mt_rand(1, 127); $entity = entity_create($entity_type, array( 'type' => $bundle, - $this->fieldStorage->name => $value, + $field_name => $value, )); $entity->save(); @@ -484,12 +485,12 @@ function testFieldSqlStorageBundleRename() { // Check that the 'bundle' column has been updated in storage. $row = db_select($this->table, 't') - ->fields('t', array('bundle', $this->fieldStorage->name . '_value')) + ->fields('t', array('bundle', $field_name . '_value')) ->condition('entity_id', $entity->id()) ->execute() ->fetch(); $this->assertEqual($row->bundle, $bundle_new); - $this->assertEqual($row->{$this->fieldStorage->name . '_value'}, $value); + $this->assertEqual($row->{$field_name . '_value'}, $value); } /** @@ -505,7 +506,7 @@ public function testTableNames() { $field_name = 'short_field_name'; $field_storage = entity_create('field_storage_config', array( 'entity_type' => $entity_type, - 'name' => $field_name, + 'field_name' => $field_name, 'type' => 'test_field', )); $expected = 'short_entity_type__short_field_name'; @@ -518,7 +519,7 @@ public function testTableNames() { $field_name = 'long_field_name_abcdefghijklmnopqrstuvwxyz'; $field_storage = entity_create('field_storage_config', array( 'entity_type' => $entity_type, - 'name' => $field_name, + 'field_name' => $field_name, 'type' => 'test_field', )); $expected = 'short_entity_type__' . substr(hash('sha256', $field_storage->uuid()), 0, 10); @@ -531,7 +532,7 @@ public function testTableNames() { $field_name = 'short_field_name'; $field_storage = entity_create('field_storage_config', array( 'entity_type' => $entity_type, - 'name' => $field_name, + 'field_name' => $field_name, 'type' => 'test_field', )); $expected = 'long_entity_type_abcdefghijklmnopq__' . substr(hash('sha256', $field_storage->uuid()), 0, 10); @@ -544,7 +545,7 @@ public function testTableNames() { $field_name = 'long_field_name_abcdefghijklmnopqrstuvwxyz'; $field_storage = entity_create('field_storage_config', array( 'entity_type' => $entity_type, - 'name' => $field_name, + 'field_name' => $field_name, 'type' => 'test_field', )); $expected = 'long_entity_type_abcdefghijklmnopq__' . substr(hash('sha256', $field_storage->uuid()), 0, 10); @@ -554,7 +555,7 @@ public function testTableNames() { // Try creating a second field and check there are no clashes. $field_storage2 = entity_create('field_storage_config', array( 'entity_type' => $entity_type, - 'name' => $field_name . '2', + 'field_name' => $field_name . '2', 'type' => 'test_field', )); $this->assertNotEqual($this->table_mapping->getDedicatedDataTableName($field_storage), $this->table_mapping->getDedicatedDataTableName($field_storage2)); @@ -563,7 +564,7 @@ public function testTableNames() { // Deleted field. $field_storage = entity_create('field_storage_config', array( 'entity_type' => 'some_entity_type', - 'name' => 'some_field_name', + 'field_name' => 'some_field_name', 'type' => 'test_field', 'deleted' => TRUE, )); diff --git a/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php b/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php index e625f42eef4c6f02ee12dee76a5a7f36fcd06dd0..1f9c85d0860f1781313277fc1752a0b338a1678c 100644 --- a/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php +++ b/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php @@ -28,8 +28,8 @@ protected function setUp() { // Auto-create a field for testing. entity_create('field_storage_config', array( - 'name' => 'test_multiple', 'entity_type' => 'user', + 'field_name' => 'test_multiple', 'type' => 'text', 'cardinality' => -1, 'translatable' => FALSE, diff --git a/core/modules/system/src/Tests/Form/RebuildTest.php b/core/modules/system/src/Tests/Form/RebuildTest.php index 70755c315a33e5987e6f7205b0f550a75cae5167..7affa6071dcb2fab923992c3aa3412c98123b35e 100644 --- a/core/modules/system/src/Tests/Form/RebuildTest.php +++ b/core/modules/system/src/Tests/Form/RebuildTest.php @@ -66,7 +66,7 @@ function testPreserveFormActionAfterAJAX() { // Create a multi-valued field for 'page' nodes to use for Ajax testing. $field_name = 'field_ajax_test'; entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'node', 'type' => 'text', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/system/tests/modules/entity_test/entity_test.install b/core/modules/system/tests/modules/entity_test/entity_test.install index 541191d2920887379174cda5039a91c2b5d77dd1..4d2e0f3cf519e8b3c9059764b04c5d9eb672d10f 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.install +++ b/core/modules/system/tests/modules/entity_test/entity_test.install @@ -18,8 +18,8 @@ function entity_test_install() { foreach ($entity_types as $entity_type) { // Auto-create fields for testing. entity_create('field_storage_config', array( - 'name' => 'field_test_text', 'entity_type' => $entity_type, + 'field_name' => 'field_test_text', 'type' => 'text', 'cardinality' => 1, ))->save(); diff --git a/core/modules/taxonomy/src/Entity/Vocabulary.php b/core/modules/taxonomy/src/Entity/Vocabulary.php index 44913f1904cac15735e5d1790763de608eefe086..e65055147380eb7f8313b7c649047c9dc66d59b2 100644 --- a/core/modules/taxonomy/src/Entity/Vocabulary.php +++ b/core/modules/taxonomy/src/Entity/Vocabulary.php @@ -105,26 +105,26 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) { // fields. $field_ids = array(); $field_map = \Drupal::entityManager()->getFieldMapByFieldType('taxonomy_term_reference'); - foreach ($field_map as $entity_type => $fields) { - foreach ($fields as $field => $info) { - $field_ids[] = $entity_type . '.' . $field; + foreach ($field_map as $entity_type => $field_storages) { + foreach ($field_storages as $field_storage => $info) { + $field_ids[] = $entity_type . '.' . $field_storage; } } - $fields = \Drupal::entityManager()->getStorage('field_storage_config')->loadMultiple($field_ids); + $field_storages = \Drupal::entityManager()->getStorage('field_storage_config')->loadMultiple($field_ids); - foreach ($fields as $field) { - $update_field = FALSE; + foreach ($field_storages as $field_storage) { + $update_storage = FALSE; - foreach ($field->settings['allowed_values'] as &$value) { + foreach ($field_storage->settings['allowed_values'] as &$value) { if ($value['vocabulary'] == $this->getOriginalId()) { $value['vocabulary'] = $this->id(); - $update_field = TRUE; + $update_storage = TRUE; } } - if ($update_field) { - $field->save(); + if ($update_storage) { + $field_storage->save(); } } } @@ -160,24 +160,24 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti } // Load all Taxonomy module fields and delete those which use only this // vocabulary. - $taxonomy_fields = entity_load_multiple_by_properties('field_storage_config', array('module' => 'taxonomy')); - foreach ($taxonomy_fields as $taxonomy_field) { - $modified_field = FALSE; + $field_storages = entity_load_multiple_by_properties('field_storage_config', array('module' => 'taxonomy')); + foreach ($field_storages as $field_storage) { + $modified_storage = FALSE; // Term reference fields may reference terms from more than one // vocabulary. - foreach ($taxonomy_field->settings['allowed_values'] as $key => $allowed_value) { + foreach ($field_storage->settings['allowed_values'] as $key => $allowed_value) { if (isset($vocabularies[$allowed_value['vocabulary']])) { - unset($taxonomy_field->settings['allowed_values'][$key]); - $modified_field = TRUE; + unset($field_storage->settings['allowed_values'][$key]); + $modified_storage = TRUE; } } - if ($modified_field) { - if (empty($taxonomy_field->settings['allowed_values'])) { - $taxonomy_field->delete(); + if ($modified_storage) { + if (empty($field_storage->settings['allowed_values'])) { + $field_storage->delete(); } else { // Update the field definition with the new allowed values. - $taxonomy_field->save(); + $field_storage->save(); } } } diff --git a/core/modules/taxonomy/src/Tests/LegacyTest.php b/core/modules/taxonomy/src/Tests/LegacyTest.php index b067476e610fb69498ede2c04342dd01df0aa1c3..2d1190051d932345c6415fd9175851993e78d47f 100644 --- a/core/modules/taxonomy/src/Tests/LegacyTest.php +++ b/core/modules/taxonomy/src/Tests/LegacyTest.php @@ -36,7 +36,7 @@ protected function setUp() { $field_name = 'field_' . $vocabulary->id(); entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/taxonomy/src/Tests/RssTest.php b/core/modules/taxonomy/src/Tests/RssTest.php index 55b663d235c1ab35bcde5503610750a36d17ea29..acfc4ae431a2fa5332c93c7d590e2c60da1ca9d3 100644 --- a/core/modules/taxonomy/src/Tests/RssTest.php +++ b/core/modules/taxonomy/src/Tests/RssTest.php @@ -33,7 +33,7 @@ protected function setUp() { $this->field_name = 'taxonomy_' . $this->vocabulary->id(); $this->fieldStorage = entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php b/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php index f2bef102e854470cc2147925df38d80e13406ffa..9cb33723f651b5a554d446b08cea905de980f496 100644 --- a/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php +++ b/core/modules/taxonomy/src/Tests/TaxonomyImageTest.php @@ -39,7 +39,7 @@ protected function setUp() { $entity_type = 'taxonomy_term'; $name = 'field_test'; entity_create('field_storage_config', array( - 'name' => $name, + 'field_name' => $name, 'entity_type' => $entity_type, 'type' => 'image', 'settings' => array( diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTermReferenceItemTest.php b/core/modules/taxonomy/src/Tests/TaxonomyTermReferenceItemTest.php index 47eeea2610b4ec6d81e761077d5f9981071d3aae..12d6a111639397a9bb5aecc3d4a10c2be36292e3 100644 --- a/core/modules/taxonomy/src/Tests/TaxonomyTermReferenceItemTest.php +++ b/core/modules/taxonomy/src/Tests/TaxonomyTermReferenceItemTest.php @@ -46,7 +46,7 @@ protected function setUp() { $vocabulary->save(); entity_create('field_storage_config', array( - 'name' => 'field_test_taxonomy', + 'field_name' => 'field_test_taxonomy', 'entity_type' => 'entity_test', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/taxonomy/src/Tests/TermFieldMultipleVocabularyTest.php b/core/modules/taxonomy/src/Tests/TermFieldMultipleVocabularyTest.php index 1b34bc04c5c85941dbd1ecf530afedeba9fd7291..d7ee8a13bd0544ac098c3ac9107389efc8fd8d26 100644 --- a/core/modules/taxonomy/src/Tests/TermFieldMultipleVocabularyTest.php +++ b/core/modules/taxonomy/src/Tests/TermFieldMultipleVocabularyTest.php @@ -38,7 +38,7 @@ protected function setUp() { // Set up a field storage and a field. $this->field_name = drupal_strtolower($this->randomMachineName()); entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'entity_test', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/taxonomy/src/Tests/TermFieldTest.php b/core/modules/taxonomy/src/Tests/TermFieldTest.php index ea06f5607808bd7c8d33268558f72221a02556b7..10c950c784c1d0d6eb1eed724aec8833dfae401f 100644 --- a/core/modules/taxonomy/src/Tests/TermFieldTest.php +++ b/core/modules/taxonomy/src/Tests/TermFieldTest.php @@ -47,7 +47,7 @@ protected function setUp() { // Setup a field. $this->field_name = drupal_strtolower($this->randomMachineName()); $this->field_storage = entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'entity_test', 'type' => 'taxonomy_term_reference', 'settings' => array( diff --git a/core/modules/taxonomy/src/Tests/TermIndexTest.php b/core/modules/taxonomy/src/Tests/TermIndexTest.php index 8ad3968e9b338e922f61bfb2e364df66abcc50bf..a6a6ea56d9f33291ff38303321f611ededfa8df7 100644 --- a/core/modules/taxonomy/src/Tests/TermIndexTest.php +++ b/core/modules/taxonomy/src/Tests/TermIndexTest.php @@ -36,7 +36,7 @@ protected function setUp() { $this->field_name_1 = drupal_strtolower($this->randomMachineName()); entity_create('field_storage_config', array( - 'name' => $this->field_name_1, + 'field_name' => $this->field_name_1, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, @@ -67,7 +67,7 @@ protected function setUp() { $this->field_name_2 = drupal_strtolower($this->randomMachineName()); entity_create('field_storage_config', array( - 'name' => $this->field_name_2, + 'field_name' => $this->field_name_2, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/taxonomy/src/Tests/TermTest.php b/core/modules/taxonomy/src/Tests/TermTest.php index fa10bb1bb33e76e369499004ecfc586c502a4aef..bb7ec06a1e4213daf1aff24e2413eaa64ee28f17 100644 --- a/core/modules/taxonomy/src/Tests/TermTest.php +++ b/core/modules/taxonomy/src/Tests/TermTest.php @@ -28,7 +28,7 @@ protected function setUp() { $field_name = 'taxonomy_' . $this->vocabulary->id(); entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/taxonomy/src/Tests/TokenReplaceTest.php b/core/modules/taxonomy/src/Tests/TokenReplaceTest.php index ab6a98cf43dc658dd4b42aac3bad4e476e80f24e..d343995ced64979124e2ee1ecf47a4ac2724632d 100644 --- a/core/modules/taxonomy/src/Tests/TokenReplaceTest.php +++ b/core/modules/taxonomy/src/Tests/TokenReplaceTest.php @@ -26,7 +26,7 @@ protected function setUp() { $this->vocabulary = $this->createVocabulary(); $this->field_name = 'taxonomy_' . $this->vocabulary->id(); entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php index 26ad57e0ce2087fcc48f55e4e2c9f8fb59062db6..5536703f160f3d4c2eda5a0e8a5738172fc12d95 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php @@ -61,7 +61,7 @@ function setUp() { // Add a translatable field to the vocabulary. $field = entity_create('field_storage_config', array( - 'name' => 'field_foo', + 'field_name' => 'field_foo', 'entity_type' => 'taxonomy_term', 'type' => 'text', )); diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php index 4021b48add416a2454edc9edb8593964759cd44d..2ca806218499a2f76bb2dd7fda34e273da5bcfde 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyTermViewTest.php @@ -40,7 +40,7 @@ protected function setUp() { $this->field_name_1 = drupal_strtolower($this->randomMachineName()); entity_create('field_storage_config', array( - 'name' => $this->field_name_1, + 'field_name' => $this->field_name_1, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php index ca508ce58ef1f92ea926806a8bb229f107237ddd..ec0d2574c03e6adb96dfd4c7b22f4f91906d40cf 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyTestBase.php @@ -79,7 +79,7 @@ protected function mockStandardInstall() { $this->vocabulary->save(); $this->field_name = 'field_' . $this->vocabulary->id(); entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', // Set cardinality to unlimited for tagging. diff --git a/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php b/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php index 3f03caa9b168bda3adac711722c179838c1021da..adb35f71d5a9eb125945d1292accce24af3716c4 100644 --- a/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php +++ b/core/modules/taxonomy/src/Tests/VocabularyCrudTest.php @@ -145,7 +145,7 @@ function testTaxonomyVocabularyLoadMultiple() { function testTaxonomyVocabularyChangeMachineName() { // Add a field to the vocabulary. entity_create('field_storage_config', array( - 'name' => 'field_test', + 'field_name' => 'field_test', 'entity_type' => 'taxonomy_term', 'type' => 'test_field', ))->save(); @@ -178,7 +178,7 @@ function testUninstallReinstall() { // removed when the module is uninstalled. $field_name = drupal_strtolower($this->randomMachineName() . '_field_name'); $storage_definition = array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'taxonomy_term', 'type' => 'text', 'cardinality' => 4 diff --git a/core/modules/telephone/src/Tests/TelephoneFieldTest.php b/core/modules/telephone/src/Tests/TelephoneFieldTest.php index d95f95152f1516148d9ba60864ce279fc7a05fc2..9bc61664def298cbe837691514c82350e3b1e8a0 100644 --- a/core/modules/telephone/src/Tests/TelephoneFieldTest.php +++ b/core/modules/telephone/src/Tests/TelephoneFieldTest.php @@ -47,7 +47,7 @@ function testTelephoneField() { // Add the telepone field to the article content type. entity_create('field_storage_config', array( - 'name' => 'field_telephone', + 'field_name' => 'field_telephone', 'entity_type' => 'node', 'type' => 'telephone', ))->save(); diff --git a/core/modules/telephone/src/Tests/TelephoneItemTest.php b/core/modules/telephone/src/Tests/TelephoneItemTest.php index 4b442d4b67cefcdd1866fc336bd7880eff3a2ca5..56a64b5ac7528db6681e547614deec87d3cd9e28 100644 --- a/core/modules/telephone/src/Tests/TelephoneItemTest.php +++ b/core/modules/telephone/src/Tests/TelephoneItemTest.php @@ -30,7 +30,7 @@ protected function setUp() { // Create a telephone field storage and field for validation. entity_create('field_storage_config', array( - 'name' => 'field_test', + 'field_name' => 'field_test', 'entity_type' => 'entity_test', 'type' => 'telephone', ))->save(); diff --git a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php index a3d4342fc3c83e8a81e6d669be33f6a2ec7dc829..293926ffc03c448c8ca620ba91731c434fdaf8d8 100644 --- a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php +++ b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php @@ -56,7 +56,7 @@ protected function setUp() { ))->save(); entity_create('field_storage_config', array( - 'name' => 'formatted_text', + 'field_name' => 'formatted_text', 'entity_type' => $this->entityType, 'type' => 'text', 'settings' => array(), diff --git a/core/modules/text/src/Tests/TextFieldTest.php b/core/modules/text/src/Tests/TextFieldTest.php index 65983620cea38d3993be09f7fb9b506c42334271..905f737af3343dbd0a03c7833298376597829ec7 100644 --- a/core/modules/text/src/Tests/TextFieldTest.php +++ b/core/modules/text/src/Tests/TextFieldTest.php @@ -45,7 +45,7 @@ function testTextFieldValidation() { $max_length = 3; $field_name = drupal_strtolower($this->randomMachineName()); $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => 'text', 'settings' => array( @@ -87,7 +87,7 @@ function _testTextfieldWidgets($field_type, $widget_type) { // Create a field. $field_name = drupal_strtolower($this->randomMachineName()); $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => $field_type )); @@ -148,7 +148,7 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) { // Create a field. $field_name = drupal_strtolower($this->randomMachineName()); $field_storage = entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'entity_test', 'type' => $field_type )); diff --git a/core/modules/text/src/Tests/TextWithSummaryItemTest.php b/core/modules/text/src/Tests/TextWithSummaryItemTest.php index 560e880e4b095254514c219a5766593873d7082e..b98147aabac2d0b91b36bb1b78d301c542d944d4 100644 --- a/core/modules/text/src/Tests/TextWithSummaryItemTest.php +++ b/core/modules/text/src/Tests/TextWithSummaryItemTest.php @@ -99,7 +99,7 @@ public function testCrudAndUpdate() { protected function createField($entity_type) { // Create a field . $this->fieldStorage = entity_create('field_storage_config', array( - 'name' => 'summary_field', + 'field_name' => 'summary_field', 'entity_type' => $entity_type, 'type' => 'text_with_summary', 'settings' => array( diff --git a/core/modules/user/src/Tests/UserCreateTest.php b/core/modules/user/src/Tests/UserCreateTest.php index 4a67b5f7d70db2dc45fe627821fd7d598a38cbd2..911c9ae32e2e32ef1d5ea5b7338b2abb3c21fabe 100644 --- a/core/modules/user/src/Tests/UserCreateTest.php +++ b/core/modules/user/src/Tests/UserCreateTest.php @@ -37,7 +37,7 @@ protected function testUserAdd() { // Create a field. $field_name = 'test_field'; entity_create('field_storage_config', array( - 'name' => $field_name, + 'field_name' => $field_name, 'entity_type' => 'user', 'module' => 'image', 'type' => 'image', diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php index cf5d85ed9b7dc13d1d7016cf160e71ffbc897f0b..f6a34bd43aceeb15fb7a3f17ceb40cd051474caa 100644 --- a/core/modules/user/src/Tests/UserRegistrationTest.php +++ b/core/modules/user/src/Tests/UserRegistrationTest.php @@ -193,7 +193,7 @@ function testRegistrationDefaultValues() { function testRegistrationWithUserFields() { // Create a field on 'user' entity type. $field_storage = entity_create('field_storage_config', array( - 'name' => 'test_user_field', + 'field_name' => 'test_user_field', 'entity_type' => 'user', 'type' => 'test_field', 'cardinality' => 1, diff --git a/core/modules/views/src/Tests/DefaultViewsTest.php b/core/modules/views/src/Tests/DefaultViewsTest.php index c02e6e86fceb0ea57be5c8a76791cbd4096ecf9a..2fa2e1e110c0c7a6d5e58ca5a6b1e9637695eda3 100644 --- a/core/modules/views/src/Tests/DefaultViewsTest.php +++ b/core/modules/views/src/Tests/DefaultViewsTest.php @@ -58,7 +58,7 @@ protected function setUp() { // Create a field. $this->field_name = drupal_strtolower($this->randomMachineName()); entity_create('field_storage_config', array( - 'name' => $this->field_name, + 'field_name' => $this->field_name, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'settings' => array( diff --git a/core/modules/views/src/Tests/Wizard/TaggedWithTest.php b/core/modules/views/src/Tests/Wizard/TaggedWithTest.php index 687a52701dece94c36df37d3d5fa826bd4516188..02e46bc58775fd186c6bbf85d20e14b4dc62d899 100644 --- a/core/modules/views/src/Tests/Wizard/TaggedWithTest.php +++ b/core/modules/views/src/Tests/Wizard/TaggedWithTest.php @@ -51,7 +51,7 @@ protected function setUp() { // Create the tag field itself. $this->tag_field_name = 'field_views_testing_tags'; $this->tag_field_storage = entity_create('field_storage_config', array( - 'name' => $this->tag_field_name, + 'field_name' => $this->tag_field_name, 'entity_type' => 'node', 'type' => 'taxonomy_term_reference', 'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED, diff --git a/core/profiles/standard/config/install/field.storage.node.field_image.yml b/core/profiles/standard/config/install/field.storage.node.field_image.yml index 091291af3355594b5869e2ad433b0bdf7ef23553..ac5d8b387439b66fd1358e922f514f9930950442 100644 --- a/core/profiles/standard/config/install/field.storage.node.field_image.yml +++ b/core/profiles/standard/config/install/field.storage.node.field_image.yml @@ -1,5 +1,5 @@ id: node.field_image -name: field_image +field_name: field_image entity_type: node type: image module: image diff --git a/core/profiles/standard/config/install/field.storage.node.field_tags.yml b/core/profiles/standard/config/install/field.storage.node.field_tags.yml index 5c4f3182f704a06a0a471b912a59c8c332a7f48b..418169406724f5599cc645171eeca9a4ffd5b660 100644 --- a/core/profiles/standard/config/install/field.storage.node.field_tags.yml +++ b/core/profiles/standard/config/install/field.storage.node.field_tags.yml @@ -1,5 +1,5 @@ id: node.field_tags -name: field_tags +field_name: field_tags entity_type: node type: taxonomy_term_reference module: taxonomy diff --git a/core/profiles/standard/config/install/field.storage.user.user_picture.yml b/core/profiles/standard/config/install/field.storage.user.user_picture.yml index 986d7bfa8a7846311edbfa04ce0ca14b3635848d..2987390478e892e3701b72edc15c04cc284e4932 100644 --- a/core/profiles/standard/config/install/field.storage.user.user_picture.yml +++ b/core/profiles/standard/config/install/field.storage.user.user_picture.yml @@ -1,7 +1,7 @@ id: user.user_picture status: true langcode: en -name: user_picture +field_name: user_picture entity_type: user type: image settings: