diff --git a/core/modules/comment/src/Tests/CommentLanguageTest.php b/core/modules/comment/src/Tests/CommentLanguageTest.php index ab70e7d..1ee8bfe 100644 --- a/core/modules/comment/src/Tests/CommentLanguageTest.php +++ b/core/modules/comment/src/Tests/CommentLanguageTest.php @@ -71,7 +71,7 @@ protected function setUp() { // Make comment body translatable. $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body'); - $field_storage->translatable = TRUE; + $field_storage->setTranslatable(TRUE); $field_storage->save(); $this->assertTrue($field_storage->isTranslatable(), 'Comment body is translatable.'); } diff --git a/core/modules/comment/src/Tests/CommentTranslationUITest.php b/core/modules/comment/src/Tests/CommentTranslationUITest.php index 64afbd7..21f14e3 100644 --- a/core/modules/comment/src/Tests/CommentTranslationUITest.php +++ b/core/modules/comment/src/Tests/CommentTranslationUITest.php @@ -76,7 +76,7 @@ protected function getTranslatorPermissions() { function setupTestFields() { parent::setupTestFields(); $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body'); - $field_storage->translatable = TRUE; + $field_storage->setTranslatable(TRUE); $field_storage->save(); } diff --git a/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php b/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php index a054288..8049d0d 100644 --- a/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php +++ b/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php @@ -47,7 +47,7 @@ function setUp() { // Make the comment body field translatable. The title is already // translatable by definition. $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body'); - $field_storage->translatable = TRUE; + $field_storage->setTranslatable(TRUE); $field_storage->save(); // Set up comment titles. diff --git a/core/modules/editor/src/Tests/QuickEditIntegrationTest.php b/core/modules/editor/src/Tests/QuickEditIntegrationTest.php index 33077c3..ab48237 100644 --- a/core/modules/editor/src/Tests/QuickEditIntegrationTest.php +++ b/core/modules/editor/src/Tests/QuickEditIntegrationTest.php @@ -145,7 +145,7 @@ public function testEditorSelection() { $this->assertEqual('editor', $this->getSelectedEditor($entity->id(), $this->fieldName), "With cardinality 1, and the full_html text format, the 'editor' editor is selected."); // Editor selection with text processing, cardinality >1 - $this->fields->field_textarea_field_storage->cardinality = 2; + $this->fields->field_textarea_field_storage->setCardinality(2); $this->fields->field_textarea_field_storage->save(); $this->assertEqual('form', $this->getSelectedEditor($entity->id(), $this->fieldName), "With cardinality >1, and both items using the full_html text format, the 'form' editor is selected."); } diff --git a/core/modules/field_ui/src/Form/FieldStorageEditForm.php b/core/modules/field_ui/src/Form/FieldStorageEditForm.php index 380bbe1..dbe5a1f 100644 --- a/core/modules/field_ui/src/Form/FieldStorageEditForm.php +++ b/core/modules/field_ui/src/Form/FieldStorageEditForm.php @@ -194,7 +194,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { // Merge incoming form values into the existing field. $field_storage = $this->field->getFieldStorageDefinition(); foreach ($field_values as $key => $value) { - $field_storage->{$key} = $value; + $field_storage->set($key,$value); } // Update the field. diff --git a/core/modules/field_ui/src/Tests/ManageFieldsTest.php b/core/modules/field_ui/src/Tests/ManageFieldsTest.php index 9efd340..912318d8 100644 --- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php +++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php @@ -361,7 +361,7 @@ function testDefaultValue() { // Check that the default value can be empty when the field is marked as // required and can store unlimited values. $field_storage = FieldStorageConfig::loadByName('node', $field_name); - $field_storage->cardinality = FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED; + $field_storage->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED); $field_storage->save(); $this->drupalGet($admin_path); diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php index 735e045..28bb7b6 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserProfileFieldTest.php @@ -41,7 +41,7 @@ public function testUserProfileFields() { // Migrated a text field. $field_storage = entity_load('field_storage_config', 'user.profile_color'); $this->assertEqual($field_storage->type, 'text', 'Field type is text.'); - $this->assertEqual($field_storage->cardinality, 1, 'Text field has correct cardinality'); + $this->assertEqual($field_storage->getCardinality(), 1, 'Text field has correct cardinality'); // Migrated a textarea. $field_storage = entity_load('field_storage_config', 'user.profile_biography'); @@ -69,7 +69,7 @@ public function testUserProfileFields() { // Migrated list field. $field_storage = entity_load('field_storage_config', 'user.profile_bands'); $this->assertEqual($field_storage->type, 'text', 'Field type is text.'); - $this->assertEqual($field_storage->cardinality, -1, 'List field has correct cardinality'); + $this->assertEqual($field_storage->getCardinality(), -1, 'List field has correct cardinality'); /* // Migrated URL field. diff --git a/core/modules/node/src/Tests/NodeFieldMultilingualTest.php b/core/modules/node/src/Tests/NodeFieldMultilingualTest.php index dc8897b..dd8aec2 100644 --- a/core/modules/node/src/Tests/NodeFieldMultilingualTest.php +++ b/core/modules/node/src/Tests/NodeFieldMultilingualTest.php @@ -53,7 +53,7 @@ protected function setUp() { // Make node body translatable. $field_storage = FieldStorageConfig::loadByName('node', 'body'); - $field_storage->translatable = TRUE; + $field_storage->setTranslatable(TRUE); $field_storage->save(); } diff --git a/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php b/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php index 599b126..005a8d5 100644 --- a/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php +++ b/core/modules/node/src/Tests/Views/NodeFieldFilterTest.php @@ -51,7 +51,7 @@ function setUp() { // Make the body field translatable. The title is already translatable by // definition. $field_storage = FieldStorageConfig::loadByName('node', 'body'); - $field_storage->translatable = TRUE; + $field_storage->setTranslatable(TRUE); $field_storage->save(); // Set up node titles. diff --git a/core/modules/node/src/Tests/Views/NodeLanguageTest.php b/core/modules/node/src/Tests/Views/NodeLanguageTest.php index 0195b44..4ced144 100644 --- a/core/modules/node/src/Tests/Views/NodeLanguageTest.php +++ b/core/modules/node/src/Tests/Views/NodeLanguageTest.php @@ -57,7 +57,7 @@ protected function setUp() { // Make the body field translatable. The title is already translatable by // definition. $field_storage = FieldStorageConfig::loadByName('node', 'body'); - $field_storage->translatable = TRUE; + $field_storage->setTranslatable(TRUE); $field_storage->save(); // Set up node titles. They should not include the words "French", diff --git a/core/modules/options/options.module b/core/modules/options/options.module index 54cf4b3..9264a24 100644 --- a/core/modules/options/options.module +++ b/core/modules/options/options.module @@ -106,12 +106,12 @@ function options_allowed_values(FieldStorageDefinitionInterface $definition, Fie * Implements hook_field_storage_config_update_forbid(). */ function options_field_storage_config_update_forbid(FieldStorageConfigInterface $field_storage, FieldStorageConfigInterface $prior_field_storage) { - if ($field_storage->module == 'options' && $field_storage->hasData()) { + if ($field_storage->getModule() == 'options' && $field_storage->hasData()) { // Forbid any update that removes allowed values with actual data. $allowed_values = $field_storage->getSetting('allowed_values'); $prior_allowed_values = $prior_field_storage->getSetting('allowed_values'); $lost_keys = array_keys(array_diff_key($prior_allowed_values, $allowed_values)); - if (_options_values_in_use($field_storage->entity_type, $field_storage->getName(), $lost_keys)) { + if (_options_values_in_use($field_storage->getTargetEntityTypeId(), $field_storage->getName(), $lost_keys)) { throw new FieldStorageDefinitionUpdateForbiddenException(t('A list field (@field_name) with existing data cannot have its keys changed.', array('@field_name' => $field_storage->getName()))); } } diff --git a/core/modules/quickedit/src/Tests/EditorSelectionTest.php b/core/modules/quickedit/src/Tests/EditorSelectionTest.php index 336fbec..d148408 100644 --- a/core/modules/quickedit/src/Tests/EditorSelectionTest.php +++ b/core/modules/quickedit/src/Tests/EditorSelectionTest.php @@ -74,7 +74,7 @@ public function testText() { $this->assertEqual('plain_text', $this->getSelectedEditor($entity->id(), $field_name), "With cardinality 1, the 'plain_text' editor is selected."); // With cardinality >1 - $this->fields->field_text_field_storage->cardinality = 2; + $this->fields->field_text_field_storage->setCardinality(2); $this->fields->field_text_field_storage->save(); $this->assertEqual('form', $this->getSelectedEditor($entity->id(), $field_name), "With cardinality >1, the 'form' editor is selected."); @@ -119,7 +119,7 @@ public function testTextWysiwyg() { $this->assertEqual('wysiwyg', $this->getSelectedEditor($entity->id(), $field_name), "With cardinality 1, and the full_html text format, the 'wysiwyg' editor is selected."); // Editor selection with text field, cardinality >1. - $this->fields->field_textarea_field_storage->cardinality = 2; + $this->fields->field_textarea_field_storage->setCardinality(2); $this->fields->field_textarea_field_storage->save(); $this->assertEqual('form', $this->getSelectedEditor($entity->id(), $field_name), "With cardinality >1, and both items using the full_html text format, the 'form' editor is selected."); } @@ -150,7 +150,7 @@ public function testNumber() { $this->assertEqual('form', $this->getSelectedEditor($entity->id(), $field_name), "With cardinality 1, the 'form' editor is selected."); // Editor selection with cardinality >1. - $this->fields->field_nr_field_storage->cardinality = 2; + $this->fields->field_nr_field_storage->setCardinality(2); $this->fields->field_nr_field_storage->save(); $this->assertEqual('form', $this->getSelectedEditor($entity->id(), $field_name), "With cardinality >1, the 'form' editor is selected."); } diff --git a/core/modules/search/src/Tests/SearchLanguageTest.php b/core/modules/search/src/Tests/SearchLanguageTest.php index d576983..8a59d6c 100644 --- a/core/modules/search/src/Tests/SearchLanguageTest.php +++ b/core/modules/search/src/Tests/SearchLanguageTest.php @@ -38,7 +38,7 @@ protected function setUp() { // definition. The parent class has already created the article and page // content types. $field_storage = FieldStorageConfig::loadByName('node', 'body'); - $field_storage->translatable = TRUE; + $field_storage->setTranslatable(TRUE); $field_storage->save(); // Create a few page nodes with multilingual body values. diff --git a/core/modules/search/src/Tests/SearchMultilingualEntityTest.php b/core/modules/search/src/Tests/SearchMultilingualEntityTest.php index 49196be..5b02525 100644 --- a/core/modules/search/src/Tests/SearchMultilingualEntityTest.php +++ b/core/modules/search/src/Tests/SearchMultilingualEntityTest.php @@ -59,7 +59,7 @@ protected function setUp() { // definition. The parent class has already created the article and page // content types. $field_storage = FieldStorageConfig::loadByName('node', 'body'); - $field_storage->translatable = TRUE; + $field_storage->setTranslatable(TRUE); $field_storage->save(); // Create a few page nodes with multilingual body values. diff --git a/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php b/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php index cee9a0b..933f8dd 100644 --- a/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php +++ b/core/modules/system/src/Tests/Entity/EntityTranslationFormTest.php @@ -99,7 +99,7 @@ function testEntityFormLanguage() { // Make body translatable. $field_storage = FieldStorageConfig::loadByName('node', 'body'); - $field_storage->translatable = TRUE; + $field_storage->setTranslatable(TRUE); $field_storage->save(); $field_storage = FieldStorageConfig::loadByName('node', 'body'); $this->assertTrue($field_storage->isTranslatable(), 'Field body is translatable.'); diff --git a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php index b7fe1e9..a386b80 100644 --- a/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php +++ b/core/modules/taxonomy/src/Tests/Views/TaxonomyFieldFilterTest.php @@ -66,7 +66,7 @@ function setUp() { 'entity_type' => 'taxonomy_term', 'type' => 'text', )); - $field->translatable = TRUE; + $field->setTranslatable(TRUE); $field->save(); entity_create('field_config', array( 'field_name' => 'field_foo', diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php index 853891a..594dbed 100644 --- a/core/modules/user/src/Tests/UserRegistrationTest.php +++ b/core/modules/user/src/Tests/UserRegistrationTest.php @@ -247,7 +247,7 @@ function testRegistrationWithUserFields() { $this->assertEqual($new_user->test_user_field->value, $value, 'The field value was correclty saved.'); // Check that the 'add more' button works. - $field_storage->cardinality = FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED; + $field_storage->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED); $field_storage->save(); foreach (array('js', 'nojs') as $js) { $this->drupalGet('user/register');