diff --git a/core/includes/config.inc b/core/includes/config.inc index 8d77717..b4a0666 100644 --- a/core/includes/config.inc +++ b/core/includes/config.inc @@ -4,7 +4,6 @@ use Drupal\Core\Config\FileStorage; use Drupal\Core\Config\NullStorage; use Drupal\Core\Config\StorageInterface; -use Drupal\Core\Config\Entity\ConfigStorageController; /** * @file diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php index 03acc53..a957e4d 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php @@ -15,6 +15,18 @@ /** * Defines the storage controller class for configuration entities. + * + * Configuration object names of configuration entities are comprised of two + * parts, separated by a dot: + * - config_prefix: A string denoting the owner (module/extension) of the + * configuration object, followed by arbitrary other namespace identifiers + * that are declared by the owning extension; e.g., 'node.type'. The + * config_prefix does NOT contain a trailing dot. It is defined by the entity + * type's annotation. + * - ID: A string denoting the entity ID within the entity type namespace; e.g., + * 'article'. Entity IDs may contain dots/periods. The entire remaining string + * after the config_prefix in a config name forms the entity ID. Additional or + * custom suffixes are not possible. */ class ConfigStorageController implements EntityStorageControllerInterface { diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php index 4f51c68..f851cbc 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php @@ -43,10 +43,10 @@ function testList() { // Get a list of ConfigTest entities and confirm that it contains the // ConfigTest entity provided by the config_test module. - // @see config_test.dynamic.test.config.yml + // @see config_test.dynamic.dotted.default.yml $list = $controller->load(); $this->assertEqual(count($list), 1, '1 ConfigTest entity found.'); - $entity = $list['test.config']; + $entity = $list['dotted.default']; $this->assertTrue(!empty($entity), '"Default" ConfigTest entity ID found.'); $this->assertTrue($entity instanceof ConfigTest, '"Default" ConfigTest entity is an instance of ConfigTest.'); @@ -91,7 +91,7 @@ function testList() { $build_operations = $controller->buildOperations($entity); $expected_items = array( 'label' => 'Default', - 'id' => 'test.config', + 'id' => 'dotted.default', 'operations' => array( 'data' => $build_operations, ), @@ -135,7 +135,7 @@ function testListUI() { // the second contains the machine name, and the third contains the // operations list. $this->assertIdentical((string) $elements[0], 'Default'); - $this->assertIdentical((string) $elements[1], 'test.config'); + $this->assertIdentical((string) $elements[1], 'dotted.default'); $this->assertTrue($elements[2]->children()->xpath('//ul'), 'Operations list found.'); // Add a new entity using the operations link. @@ -189,7 +189,7 @@ function testListUI() { // Verify that the text of the label and machine name does not appear in // the list (though it may appear elsewhere on the page). $this->assertNoFieldByXpath('//td', 'Default', "No label found for deleted 'Default' entity."); - $this->assertNoFieldByXpath('//td', 'test.config', "No machine name found for deleted 'Default' entity."); + $this->assertNoFieldByXpath('//td', 'dotted.default', "No machine name found for deleted 'Default' entity."); // Confirm that the empty text is displayed. $this->assertText('There is no Test configuration yet.'); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php index 919ac31..1e277b8 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityUnitTest.php @@ -8,7 +8,6 @@ namespace Drupal\config\Tests; use Drupal\simpletest\DrupalUnitTestBase; -use Drupal\Core\Config\Entity\ConfigStorageController; /** * Unit tests for configuration controllers and objects. @@ -43,7 +42,7 @@ public function testStorageControllerMethods() { // Test the static extractID() method. $expected_id = 'test_id'; $config_name = $info['config_prefix'] . '.' . $expected_id; - $this->assertIdentical(ConfigStorageController::getIDFromConfigName($config_name, $info['config_prefix']), $expected_id); + $this->assertIdentical($controller::getIDFromConfigName($config_name, $info['config_prefix']), $expected_id); } } diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php index ab072ec..9d6e331 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImportTest.php @@ -43,11 +43,11 @@ function setUp() { * Tests omission of module APIs for bare configuration operations. */ function testNoImport() { - $dynamic_name = 'config_test.dynamic.test.config'; + $dynamic_name = 'config_test.dynamic.dotted.default'; // Verify the default configuration values exist. $config = config($dynamic_name); - $this->assertIdentical($config->get('id'), 'test.config'); + $this->assertIdentical($config->get('id'), 'dotted.default'); // Verify that a bare config() does not involve module APIs. $this->assertFalse(isset($GLOBALS['hook_config_test'])); @@ -57,13 +57,13 @@ function testNoImport() { * Tests deletion of configuration during import. */ function testDeleted() { - $dynamic_name = 'config_test.dynamic.test.config'; + $dynamic_name = 'config_test.dynamic.dotted.default'; $storage = $this->container->get('config.storage'); $staging = $this->container->get('config.storage.staging'); // Verify the default configuration values exist. $config = config($dynamic_name); - $this->assertIdentical($config->get('id'), 'test.config'); + $this->assertIdentical($config->get('id'), 'dotted.default'); // Create an empty manifest to delete the configuration object. $staging->write('manifest.config_test.dynamic', array()); @@ -144,7 +144,7 @@ function testNew() { */ function testUpdated() { $name = 'config_test.system'; - $dynamic_name = 'config_test.dynamic.test.config'; + $dynamic_name = 'config_test.dynamic.dotted.default'; $storage = $this->container->get('config.storage'); $staging = $this->container->get('config.storage.staging'); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php index 0d45d32..42a6fec 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigInstallTest.php @@ -34,11 +34,11 @@ function setUp() { */ function testModuleInstallation() { $default_config = 'config_test.system'; - $default_configuration_entity = 'config_test.dynamic.test.config'; + $default_configuration_entity = 'config_test.dynamic.dotted.default'; $default_config_manifest = 'manifest.config_test.dynamic'; $expected_manifest_data = array( - 'test.config' => array( - 'name' => 'config_test.dynamic.test.config', + 'dotted.default' => array( + 'name' => 'config_test.dynamic.dotted.default', ), ); $default_empty_config_manifest = 'manifest.config_test.empty_manifest'; diff --git a/core/modules/config/tests/config_test/config/config_test.dynamic.test.config.yml b/core/modules/config/tests/config_test/config/config_test.dynamic.dotted.default.yml similarity index 86% rename from core/modules/config/tests/config_test/config/config_test.dynamic.test.config.yml rename to core/modules/config/tests/config_test/config/config_test.dynamic.dotted.default.yml index 58109e2..bc52b35 100644 --- a/core/modules/config/tests/config_test/config/config_test.dynamic.test.config.yml +++ b/core/modules/config/tests/config_test/config/config_test.dynamic.dotted.default.yml @@ -1,4 +1,4 @@ -id: test.config +id: dotted.default label: Default protected_property: Default # Intentionally commented out to verify default status behavior. diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php b/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php index 50472d6..232a847 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php @@ -8,7 +8,6 @@ namespace Drupal\views\Tests; use Drupal\Core\Config\FileStorage; -use Drupal\Core\Config\Entity\ConfigStorageController; /** * Provides tests view data and the base test schema with sample data records.