diff -u b/core/modules/block/src/Entity/Block.php b/core/modules/block/src/Entity/Block.php --- b/core/modules/block/src/Entity/Block.php +++ b/core/modules/block/src/Entity/Block.php @@ -33,8 +33,7 @@ * admin_permission = "administer blocks", * fieldable = FALSE, * entity_keys = { - * "id" = "id", - * "label" = "label" + * "id" = "id" * }, * links = { * "delete-form" = "block.admin_block_delete", diff -u b/core/modules/block/src/Tests/BlockStorageUnitTest.php b/core/modules/block/src/Tests/BlockStorageUnitTest.php --- b/core/modules/block/src/Tests/BlockStorageUnitTest.php +++ b/core/modules/block/src/Tests/BlockStorageUnitTest.php @@ -90,12 +90,14 @@ // Ensure that default values are filled in. $expected_properties = array( + 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->id, + 'status' => TRUE, + 'dependencies' => array('module' => array('block_test'), 'theme' => array('stark')), 'id' => 'test_block', 'theme' => 'stark', 'region' => '-1', 'weight' => NULL, 'provider' => NULL, - 'status' => TRUE, 'visibility' => NULL, 'plugin' => 'test_html', 'settings' => array( @@ -108,9 +110,8 @@ 'contexts' => array(), ), ), - 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->id, - 'dependencies' => array('module' => array('block_test'), 'theme' => array('stark')), ); + $this->assertIdentical($actual_properties, $expected_properties); $this->assertTrue($entity->getPlugin() instanceof TestHtmlBlock, 'The entity has an instance of the correct block plugin.'); diff -u b/core/modules/config/tests/config_test/config/schema/config_test.schema.yml b/core/modules/config/tests/config_test/config/schema/config_test.schema.yml --- b/core/modules/config/tests/config_test/config/schema/config_test.schema.yml +++ b/core/modules/config/tests/config_test/config/schema/config_test.schema.yml @@ -1,7 +1,7 @@ # Schema for the configuration files of the Configuration Test module. config_test_dynamic: - type: mapping + type: config_entity mapping: id: type: string @@ -18,18 +18,6 @@ test_dependencies: type: config_dependencies label: 'Configuration dependencies' - status: - type: boolean - label: 'Status' - uuid: - type: string - label: 'UUID' - langcode: - type: string - label: 'Default language' - dependencies: - type: config_dependencies - label: 'Configuration dependencies' protected_property: type: string label: 'Protected property' @@ -43,14 +31,11 @@ label: 'Config test dynamic settings' config_test.query.*: - type: mapping + type: config_entity mapping: id: type: string label: 'ID' - uuid: - type: string - label: 'UUID' label: type: label label: 'Label' @@ -62,15 +47,6 @@ number: type: integer label: 'number' - status: - type: boolean - label: 'Status' - langcode: - type: string - label: 'Default language' - dependencies: - type: config_dependencies - label: 'Configuration dependencies' config_test.types: type: mapping diff -u b/core/modules/entity/config/schema/entity.schema.yml b/core/modules/entity/config/schema/entity.schema.yml --- b/core/modules/entity/config/schema/entity.schema.yml +++ b/core/modules/entity/config/schema/entity.schema.yml @@ -33,6 +33,12 @@ type: config_entity label: 'Entity form mode settings' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' targetEntityType: type: string label: 'Target entity type' @@ -45,6 +51,12 @@ type: config_entity label: 'Entity display' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' targetEntityType: type: string label: 'Target entity type' @@ -71,6 +83,9 @@ type: config_entity label: 'Entity form display' mapping: + id: + type: string + label: 'ID' targetEntityType: type: string label: 'Target entity type' diff -u b/core/modules/field/src/Entity/FieldInstanceConfig.php b/core/modules/field/src/Entity/FieldInstanceConfig.php --- b/core/modules/field/src/Entity/FieldInstanceConfig.php +++ b/core/modules/field/src/Entity/FieldInstanceConfig.php @@ -635,10 +635,7 @@ */ public function __sleep() { // Only serialize properties from self::toArray(). - $properties = array_keys(array_intersect_key($this->toArray(), get_object_vars($this))); - // Serialize $entityTypeId property so that toArray() works when waking up. - $properties[] = 'entityTypeId'; - return $properties; + return array_keys(array_intersect_key($this->toArray(), get_object_vars($this))); } /** @@ -663,7 +660,10 @@ */ public function __sleep() { // Only serialize properties from self::toArray(). - return array_keys(array_intersect_key($this->toArray(), get_object_vars($this))); + $properties = array_keys(array_intersect_key($this->toArray(), get_object_vars($this))); + // Serialize $entityTypeId property so that toArray() works when waking up. + $properties[] = 'entityTypeId'; + return $properties; } /** only in patch2: unchanged: --- a/core/config/schema/core.data_types.schema.yml +++ b/core/config/schema/core.data_types.schema.yml @@ -235,15 +235,9 @@ config_dependencies: config_entity: type: mapping mapping: - id: - type: string - label: 'ID' uuid: type: string label: 'UUID' - label: - type: label - label: 'Label' langcode: type: string label: 'Default language' only in patch2: unchanged: --- a/core/modules/block/config/schema/block.schema.yml +++ b/core/modules/block/config/schema/block.schema.yml @@ -4,6 +4,9 @@ block.block.*: type: config_entity label: 'Block' mapping: + id: + type: string + label: 'ID' theme: type: string label: 'Theme' only in patch2: unchanged: --- a/core/modules/block/custom_block/config/schema/custom_block.schema.yml +++ b/core/modules/block/custom_block/config/schema/custom_block.schema.yml @@ -4,6 +4,12 @@ custom_block.type.*: type: config_entity label: 'Custom block type settings' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' revision: type: integer label: 'Create new revision' only in patch2: unchanged: --- a/core/modules/breakpoint/config/schema/breakpoint.schema.yml +++ b/core/modules/breakpoint/config/schema/breakpoint.schema.yml @@ -3,6 +3,12 @@ breakpoint.breakpoint.*.*.*: type: config_entity label: 'Defines the Breakpoint entity' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' name: type: string label: 'Machine name' @@ -29,6 +35,12 @@ breakpoint.breakpoint_group.*.*.*: type: config_entity label: 'Breakpoint group settings' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' name: type: string label: 'Machine name' only in patch2: unchanged: --- a/core/modules/config/src/Tests/ConfigDiffTest.php +++ b/core/modules/config/src/Tests/ConfigDiffTest.php @@ -111,11 +111,12 @@ function testDiff() { $diff = \Drupal::service('config.manager')->diff($active, $staging, 'config_test.dynamic.' . $new_test_entity_id, $config_name); $edits = $diff->getEdits(); - $this->assertEqual($edits[0]->type, 'change', 'The second item in the diff is a copy.'); - $this->assertEqual($edits[0]->orig, array('id: ' . $new_test_entity_id)); - $this->assertEqual($edits[0]->closing, array('id: ' . $test_entity_id)); - $this->assertEqual($edits[1]->type, 'copy', 'The second item in the diff is a copy.'); - $this->assertEqual(count($edits), 2, 'There are two items in the diff.'); + $this->assertEqual($edits[0]->type, 'copy', 'The first item in the diff is a copy.'); + $this->assertEqual($edits[1]->type, 'change', 'The second item in the diff is a change.'); + $this->assertEqual($edits[1]->orig, array('id: ' . $new_test_entity_id)); + $this->assertEqual($edits[1]->closing, array('id: ' . $test_entity_id)); + $this->assertEqual($edits[2]->type, 'copy', 'The third item in the diff is a copy.'); + $this->assertEqual(count($edits), 3, 'There are three items in the diff.'); } /** only in patch2: unchanged: --- a/core/modules/config/src/Tests/ConfigImportUITest.php +++ b/core/modules/config/src/Tests/ConfigImportUITest.php @@ -56,15 +56,15 @@ function testImport() { // Create new config entity. $original_dynamic_data = array( + 'uuid' => '30df59bd-7b03-4cf7-bb35-d42fc49f0651', + 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->id, + 'status' => TRUE, + 'dependencies' => array(), 'id' => 'new', 'label' => 'New', 'weight' => 0, 'style' => '', 'test_dependencies' => array(), - 'status' => TRUE, - 'uuid' => '30df59bd-7b03-4cf7-bb35-d42fc49f0651', - 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->id, - 'dependencies' => array(), 'protected_property' => '', ); $staging->write($dynamic_name, $original_dynamic_data); @@ -349,31 +349,31 @@ function testImportErrorLog() { $uuid = $this->container->get('uuid'); $values_primary = array( + 'uuid' => $uuid->generate(), + 'langcode' => 'en', + 'status' => TRUE, + 'dependencies' => array(), 'id' => 'primary', 'label' => 'Primary', 'weight' => 0, 'style' => NULL, 'test_dependencies' => array(), - 'status' => TRUE, - 'uuid' => $uuid->generate(), - 'langcode' => 'en', - 'dependencies' => array(), 'protected_property' => null, ); $staging->write($name_primary, $values_primary); $values_secondary = array( - 'id' => 'secondary', - 'label' => 'Secondary Sync', - 'weight' => 0, - 'style' => NULL, - 'test_dependencies' => array(), - 'status' => TRUE, 'uuid' => $uuid->generate(), 'langcode' => 'en', + 'status' => TRUE, // Add a dependency on primary, to ensure that is synced first. 'dependencies' => array( 'entity' => array($name_primary), ), + 'id' => 'secondary', + 'label' => 'Secondary Sync', + 'weight' => 0, + 'style' => NULL, + 'test_dependencies' => array(), 'protected_property' => null, ); $staging->write($name_secondary, $values_secondary); only in patch2: unchanged: --- a/core/modules/config/src/Tests/ConfigImporterTest.php +++ b/core/modules/config/src/Tests/ConfigImporterTest.php @@ -170,15 +170,15 @@ function testNew() { // Create new config entity. $original_dynamic_data = array( + 'uuid' => '30df59bd-7b03-4cf7-bb35-d42fc49f0651', + 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->id, + 'status' => TRUE, + 'dependencies' => array(), 'id' => 'new', 'label' => 'New', 'weight' => 0, 'style' => '', 'test_dependencies' => array(), - 'status' => TRUE, - 'uuid' => '30df59bd-7b03-4cf7-bb35-d42fc49f0651', - 'langcode' => \Drupal::languageManager()->getDefaultLanguage()->id, - 'dependencies' => array(), 'protected_property' => '', ); $staging->write($dynamic_name, $original_dynamic_data); only in patch2: unchanged: --- a/core/modules/config/src/Tests/ConfigSchemaTest.php +++ b/core/modules/config/src/Tests/ConfigSchemaTest.php @@ -135,12 +135,8 @@ function testSchemaMapping() { $expected['label'] = 'Image style'; $expected['class'] = '\Drupal\Core\Config\Schema\Mapping'; $expected['mapping']['name']['type'] = 'string'; - $expected['mapping']['id']['label'] = 'ID'; - $expected['mapping']['id']['type'] = 'string'; $expected['mapping']['uuid']['type'] = 'string'; $expected['mapping']['uuid']['label'] = 'UUID'; - $expected['mapping']['label']['type'] = 'label'; - $expected['mapping']['label']['label'] = 'Label'; $expected['mapping']['langcode']['type'] = 'string'; $expected['mapping']['langcode']['label'] = 'Default language'; $expected['mapping']['status']['type'] = 'boolean'; @@ -148,6 +144,8 @@ function testSchemaMapping() { $expected['mapping']['dependencies']['type'] = 'config_dependencies'; $expected['mapping']['dependencies']['label'] = 'Dependencies'; $expected['mapping']['name']['type'] = 'string'; + $expected['mapping']['label']['type'] = 'label'; + $expected['mapping']['label']['label'] = 'Label'; $expected['mapping']['effects']['type'] = 'sequence'; $expected['mapping']['effects']['sequence'][0]['type'] = 'mapping'; $expected['mapping']['effects']['sequence'][0]['mapping']['id']['type'] = 'string'; only in patch2: unchanged: --- a/core/modules/contact/config/schema/contact.schema.yml +++ b/core/modules/contact/config/schema/contact.schema.yml @@ -4,6 +4,12 @@ contact.category.*: type: config_entity label: 'Contact category' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' recipients: type: sequence label: 'Recipients' only in patch2: unchanged: --- a/core/modules/field/config/schema/field.schema.yml +++ b/core/modules/field/config/schema/field.schema.yml @@ -12,6 +12,9 @@ field.field.*.*: type: config_entity label: 'Field' mapping: + id: + type: string + label: 'ID' name: type: string label: 'Name' @@ -49,6 +52,12 @@ field.instance.*.*.*: type: config_entity label: 'Field instance' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' field_uuid: type: string label: 'Field UUID' only in patch2: unchanged: --- a/core/modules/image/config/schema/image.schema.yml +++ b/core/modules/image/config/schema/image.schema.yml @@ -6,6 +6,9 @@ image.style.*: mapping: name: type: string + label: + type: label + label: 'Label' effects: type: sequence sequence: only in patch2: unchanged: --- a/core/modules/language/config/schema/language.schema.yml +++ b/core/modules/language/config/schema/language.schema.yml @@ -85,6 +85,12 @@ language.entity.*: type: config_entity label: 'Language' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' direction: type: integer label: 'Direction' only in patch2: unchanged: --- a/core/modules/rdf/config/schema/rdf.schema.yml +++ b/core/modules/rdf/config/schema/rdf.schema.yml @@ -4,6 +4,9 @@ rdf.mapping.*.*: type: config_entity label: 'RDF mapping' mapping: + id: + type: string + label: 'ID' targetEntityType: type: string label: 'Target entity type' only in patch2: unchanged: --- a/core/modules/search/config/schema/search.schema.yml +++ b/core/modules/search/config/schema/search.schema.yml @@ -68,6 +68,12 @@ search.page.*: type: config_entity label: 'Search page' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' path: type: string label: 'Search page path' only in patch2: unchanged: --- a/core/modules/shortcut/config/schema/shortcut.schema.yml +++ b/core/modules/shortcut/config/schema/shortcut.schema.yml @@ -4,6 +4,12 @@ shortcut.set.*: type: config_entity label: 'Shortcut settings' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' links: type: sequence label: 'Shortcuts' only in patch2: unchanged: --- a/core/modules/system/config/schema/system.schema.yml +++ b/core/modules/system/config/schema/system.schema.yml @@ -118,6 +118,12 @@ system.date_format.*: type: config_entity label: 'Date format' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' locked: type: boolean label: 'Locked' @@ -278,6 +284,12 @@ system.menu.*: type: config_entity label: 'Menu' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' description: type: label label: 'Menu description' @@ -289,6 +301,12 @@ system.action.*: type: config_entity label: 'System action' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' type: type: string label: 'Type' only in patch2: unchanged: --- a/core/modules/tour/config/schema/tour.schema.yml +++ b/core/modules/tour/config/schema/tour.schema.yml @@ -4,6 +4,12 @@ tour.tour.*: type: config_entity label: 'Tour settings' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' module: type: string label: 'Providing module' only in patch2: unchanged: --- a/core/modules/user/config/schema/user.schema.yml +++ b/core/modules/user/config/schema/user.schema.yml @@ -119,6 +119,12 @@ user.role.*: type: config_entity label: 'User role settings' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' weight: type: integer label: 'User role weight' only in patch2: unchanged: --- a/core/modules/views/config/schema/views.schema.yml +++ b/core/modules/views/config/schema/views.schema.yml @@ -72,6 +72,12 @@ views.view.*: type: config_entity label: 'View' mapping: + id: + type: string + label: 'ID' + label: + type: label + label: 'Label' module: type: string label: 'Module'