diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php index c8defe7..6fe1afa 100644 --- a/core/lib/Drupal/Core/Config/ConfigInstaller.php +++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php @@ -107,6 +107,8 @@ public function installDefaultConfig($type, $name) { $extension_config = $this->configFactory->get('core.extension'); $enabled_extensions = array_keys((array) $extension_config->get('module')); $enabled_extensions += array_keys((array) $extension_config->get('theme')); + // Core can provide configuration. + $enabled_extensions[] = 'core'; foreach ($collection_info->getCollectionNames(TRUE) as $collection) { $config_to_install = $this->listDefaultConfigCollection($collection, $type, $name, $enabled_extensions); diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index 4c0286a..210e259 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -358,7 +358,7 @@ protected function addDependency($type, $name) { // explicitly declare the dependency. An explicit dependency on Core, which // provides some plugins, is also not needed. // @see \Drupal\Core\Config\Entity\ConfigEntityDependency::hasDependency() - if ($type == 'module' && ($name == $this->getEntityType()->getProvider() || $name == 'Core')) { + if ($type == 'module' && ($name == $this->getEntityType()->getProvider() || $name == 'core')) { return $this; } diff --git a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php index 4059e10..e1d0731 100644 --- a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php +++ b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php @@ -234,7 +234,7 @@ protected function findDefinitions() { if (is_object($plugin_definition) && !($plugin_definition = (array) $plugin_definition)) { continue; } - if (isset($plugin_definition['provider']) && !in_array($plugin_definition['provider'], array('Core', 'Component')) && !$this->moduleHandler->moduleExists($plugin_definition['provider'])) { + if (isset($plugin_definition['provider']) && !in_array($plugin_definition['provider'], array('core', 'component')) && !$this->moduleHandler->moduleExists($plugin_definition['provider'])) { unset($definitions[$plugin_id]); } } diff --git a/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php index 130cb62..b7a2dfd 100644 --- a/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php +++ b/core/lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php @@ -9,6 +9,7 @@ use Drupal\Component\Annotation\AnnotationInterface; use Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery as ComponentAnnotatedClassDiscovery; +use Drupal\Component\Utility\Unicode; /** * Defines a discovery mechanism to find annotated plugins in PSR-0 namespaces. @@ -105,7 +106,7 @@ protected function getProviderFromNamespace($namespace) { preg_match('|^Drupal\\\\(?[\w]+)\\\\|', $namespace, $matches); if (isset($matches['provider'])) { - return $matches['provider']; + return Unicode::strtolower($matches['provider']); } return NULL; diff --git a/core/modules/config_translation/src/ConfigMapperManager.php b/core/modules/config_translation/src/ConfigMapperManager.php index bb3ce65..8eb3735 100644 --- a/core/modules/config_translation/src/ConfigMapperManager.php +++ b/core/modules/config_translation/src/ConfigMapperManager.php @@ -150,7 +150,7 @@ protected function findDefinitions() { // If this plugin was provided by a module that does not exist, remove the // plugin definition. foreach ($definitions as $plugin_id => $plugin_definition) { - if (isset($plugin_definition['provider']) && !in_array($plugin_definition['provider'], array('Core', 'Component')) && (!$this->moduleHandler->moduleExists($plugin_definition['provider']) && !in_array($plugin_definition['provider'], array_keys($this->themeHandler->listInfo())))) { + if (isset($plugin_definition['provider']) && !in_array($plugin_definition['provider'], array('core', 'component')) && (!$this->moduleHandler->moduleExists($plugin_definition['provider']) && !in_array($plugin_definition['provider'], array_keys($this->themeHandler->listInfo())))) { unset($definitions[$plugin_id]); } } diff --git a/core/modules/field/src/ConfigImporterFieldPurger.php b/core/modules/field/src/ConfigImporterFieldPurger.php index db3d8b9..1fe18da 100644 --- a/core/modules/field/src/ConfigImporterFieldPurger.php +++ b/core/modules/field/src/ConfigImporterFieldPurger.php @@ -113,7 +113,7 @@ protected static function initializeSandbox(array &$context, ConfigImporter $con */ public static function getFieldsToPurge(array $extensions, array $deletes) { $providers = array_keys($extensions['module']); - $providers[] = 'Core'; + $providers[] = 'core'; $fields_to_delete = array(); // Gather fields that will be deleted during configuration synchronization diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php index a824b3a..9be5bba 100644 --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php @@ -199,11 +199,11 @@ public function testAddDependency() { $method = new \ReflectionMethod('\Drupal\Core\Config\Entity\ConfigEntityBase', 'addDependency'); $method->setAccessible(TRUE); $method->invoke($this->entity, 'module', $this->provider); - $method->invoke($this->entity, 'module', 'Core'); + $method->invoke($this->entity, 'module', 'core'); $method->invoke($this->entity, 'module', 'node'); $dependencies = $this->entity->get('dependencies'); $this->assertNotContains($this->provider, $dependencies['module']); - $this->assertNotContains('Core', $dependencies['module']); + $this->assertNotContains('core', $dependencies['module']); $this->assertContains('node', $dependencies['module']); // Test sorting of dependencies.