diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index 32c8266..ae4e6c0 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -267,10 +267,8 @@ public function toArray() { /** @var \Drupal\Core\Config\Entity\ConfigEntityTypeInterface $entity_type */ $entity_type = $this->getEntityType(); - $properties_to_export = $this->_getPropertiesToExport(); - $id_key = $entity_type->getKey('id'); - foreach ($properties_to_export as $property_name => $export_name) { + foreach ($this->getPropertiesToExport() as $property_name => $export_name) { // Special handling for IDs so that computed compound IDs work. // @see \Drupal\Core\Entity\EntityDisplayBase::id() if ($property_name == $id_key) { @@ -293,7 +291,7 @@ public function toArray() { /** * {@inheritdoc} */ - public function _getPropertiesToExport() { + public function getPropertiesToExport() { /** @var \Drupal\Core\Config\Entity\ConfigEntityTypeInterface $entity_type */ $entity_type = $this->getEntityType(); diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php index 3bfb1ba..fcdaf5a 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php @@ -229,9 +229,7 @@ public function hasTrustedData(); * @throws \Drupal\Core\Config\Schema\SchemaIncompleteException * Exception thrown when there is no 'config_export' annotation and there is * no config schema. - * - * @todo Remove underscore in Drupal 9. */ - public function _getPropertiesToExport(); + public function getPropertiesToExport(); } diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php index 28540c7..2095f25 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php @@ -471,10 +471,9 @@ public function updateFromStorageRecord(ConfigEntityInterface $entity, array $va $data = $this->mapFromStorageRecords(array($values)); $updated_entity = current($data); - $properties = $entity->_getPropertiesToExport(); $uuid_key = $this->getEntityType()->getKey('uuid'); - foreach ($properties as $property) { + foreach ($entity->getPropertiesToExport() as $property) { if ($property === $uuid_key) { // The UUID field should not be copied. continue; diff --git a/core/modules/system/tests/src/Functional/Entity/ConfigEntityImportTest.php b/core/modules/system/tests/src/Functional/Entity/ConfigEntityImportTest.php index 63786f5..852bda8 100644 --- a/core/modules/system/tests/src/Functional/Entity/ConfigEntityImportTest.php +++ b/core/modules/system/tests/src/Functional/Entity/ConfigEntityImportTest.php @@ -187,16 +187,17 @@ protected function doThirdPartySettingsUpdate() { $entity->save(); $this->assertIdentical([], $entity->getThirdPartyProviders()); - $custom_data = $this->container->get('config.storage')->read($name); + // Get a copy of the configuration before the third party setting is added. + $no_third_part_setting_config = $this->container->get('config.storage')->read($name); + // Add a third party setting. $entity->setThirdPartySetting('config_test', 'integer', 1); $entity->save(); $this->assertIdentical(1, $entity->getThirdPartySetting('config_test', 'integer')); + $has_third_part_setting_config = $this->container->get('config.storage')->read($name); - // Read the existing data, and prepare an altered version without third - // party settings. - $original_data = $this->container->get('config.storage')->read($name); - $this->assertConfigUpdateImport($name, $original_data, $custom_data); + // Ensure that a configuration import can remove a third party settings. + $this->assertConfigUpdateImport($name, $has_third_part_setting_config, $no_third_part_setting_config); } /** diff --git a/core/modules/views_ui/src/ViewUI.php b/core/modules/views_ui/src/ViewUI.php index 7af27f6..d0a6226 100644 --- a/core/modules/views_ui/src/ViewUI.php +++ b/core/modules/views_ui/src/ViewUI.php @@ -1351,8 +1351,8 @@ public function addCacheTags(array $cache_tags) { /** * @inheritDoc */ - public function _getPropertiesToExport() { - return $this->storage->_getPropertiesToExport(); + public function getPropertiesToExport() { + return $this->storage->getPropertiesToExport(); } }