diff --git a/core/includes/update.inc b/core/includes/update.inc index c3bc07a..98d9050 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -825,7 +825,7 @@ function update_language_list($flags = Language::STATE_CONFIGURABLE) { if (\Drupal::languageManager()->isMultilingual() || \Drupal::moduleHandler()->moduleExists('language')) { // Use language module configuration if available. We can not use // entity_load_multiple() because this breaks during updates. - $language_entities = config_get_storage_names_with_prefix('language.entity.'); + $language_entities = \Drupal::configFactory()->listAll('language.entity.'); // Initialize default property so callers have an easy reference and can // save the same object without data loss. diff --git a/core/lib/Drupal/Core/Config/Schema/Element.php b/core/lib/Drupal/Core/Config/Schema/Element.php index d4e29db..2563ec5 100644 --- a/core/lib/Drupal/Core/Config/Schema/Element.php +++ b/core/lib/Drupal/Core/Config/Schema/Element.php @@ -25,7 +25,7 @@ * Create typed config object. */ protected function parseElement($key, $data, $definition) { - return config_typed()->create($definition, $data, $key, $this); + return \Drupal::service('config.typed')->create($definition, $data, $key, $this); } } diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module index cdf90c7..0a8b7b4 100644 --- a/core/modules/block/custom_block/custom_block.module +++ b/core/modules/block/custom_block/custom_block.module @@ -153,7 +153,7 @@ function custom_block_entity_info_alter(&$entity_info) { */ function custom_block_entity_bundle_info() { $bundles = array(); - foreach (config_get_storage_names_with_prefix('custom_block.type.') as $config_name) { + foreach (\Drupal::configFactory()->listAll('custom_block.type.') as $config_name) { $config = \Drupal::config($config_name); $bundles['custom_block'][$config->get('id')]['label'] = $config->get('label'); } diff --git a/core/modules/breakpoint/breakpoint.module b/core/modules/breakpoint/breakpoint.module index 6c606ec..754d968 100644 --- a/core/modules/breakpoint/breakpoint.module +++ b/core/modules/breakpoint/breakpoint.module @@ -79,7 +79,7 @@ function breakpoint_modules_uninstalled($modules) { * Either Breakpoint::SOURCE_TYPE_THEME or Breakpoint::SOURCE_TYPE_MODULE. */ function _breakpoint_delete_breakpoints($list, $source_type) { - $ids = config_get_storage_names_with_prefix('breakpoint.breakpoint_group.' . $source_type . '.'); + $ids = \Drupal::configFactory()->listAll('breakpoint.breakpoint_group.' . $source_type . '.'); $entity_manager = \Drupal::entityManager(); $entity_type = $entity_manager->getDefinition('breakpoint_group'); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php index 62341ee..8b430da 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php @@ -41,21 +41,21 @@ public function setUp() { */ function testSchemaMapping() { // Nonexistent configuration key will have Unknown as metadata. - $this->assertIdentical(FALSE, config_typed()->hasConfigSchema('config_test.no_such_key')); - $definition = config_typed()->getDefinition('config_test.no_such_key'); + $this->assertIdentical(FALSE, \Drupal::service('config.typed')->hasConfigSchema('config_test.no_such_key')); + $definition = \Drupal::service('config.typed')->getDefinition('config_test.no_such_key'); $expected = array(); $expected['label'] = 'Unknown'; $expected['class'] = '\Drupal\Core\Config\Schema\Property'; $this->assertEqual($definition, $expected, 'Retrieved the right metadata for nonexistent configuration.'); // Configuration file without schema will return Unknown as well. - $this->assertIdentical(FALSE, config_typed()->hasConfigSchema('config_test.noschema')); - $definition = config_typed()->getDefinition('config_test.noschema'); + $this->assertIdentical(FALSE, \Drupal::service('config.typed')->hasConfigSchema('config_test.noschema')); + $definition = \Drupal::service('config.typed')->getDefinition('config_test.noschema'); $this->assertEqual($definition, $expected, 'Retrieved the right metadata for configuration with no schema.'); // Configuration file with only some schema. - $this->assertIdentical(TRUE, config_typed()->hasConfigSchema('config_test.someschema')); - $definition = config_typed()->getDefinition('config_test.someschema'); + $this->assertIdentical(TRUE, \Drupal::service('config.typed')->hasConfigSchema('config_test.someschema')); + $definition = \Drupal::service('config.typed')->getDefinition('config_test.someschema'); $expected = array(); $expected['label'] = 'Schema test data'; $expected['class'] = '\Drupal\Core\Config\Schema\Mapping'; @@ -64,7 +64,7 @@ function testSchemaMapping() { $this->assertEqual($definition, $expected, 'Retrieved the right metadata for configuration with only some schema.'); // Check type detection on elements with undefined types. - $config = config_typed()->get('config_test.someschema'); + $config = \Drupal::service('config.typed')->get('config_test.someschema'); $definition = $config['testitem']->getDefinition(); $expected = array(); $expected['label'] = 'Test item'; @@ -79,7 +79,7 @@ function testSchemaMapping() { $this->assertEqual($definition, $expected, 'Automatic type fallback on non-string item worked.'); // Simple case, straight metadata. - $definition = config_typed()->getDefinition('system.maintenance'); + $definition = \Drupal::service('config.typed')->getDefinition('system.maintenance'); $expected = array(); $expected['label'] = 'Maintenance mode'; $expected['class'] = '\Drupal\Core\Config\Schema\Mapping'; @@ -94,7 +94,7 @@ function testSchemaMapping() { $this->assertEqual($definition, $expected, 'Retrieved the right metadata for system.maintenance'); // More complex case, generic type. Metadata for image style. - $definition = config_typed()->getDefinition('image.style.large'); + $definition = \Drupal::service('config.typed')->getDefinition('image.style.large'); $expected = array(); $expected['label'] = 'Image style'; $expected['class'] = '\Drupal\Core\Config\Schema\Mapping'; @@ -116,7 +116,7 @@ function testSchemaMapping() { $this->assertEqual($definition, $expected, 'Retrieved the right metadata for image.style.large'); // More complex, type based on a complex one. - $definition = config_typed()->getDefinition('image.effect.image_scale'); + $definition = \Drupal::service('config.typed')->getDefinition('image.effect.image_scale'); // This should be the schema for image.effect.image_scale. $expected = array(); $expected['label'] = 'Image scale'; @@ -131,7 +131,7 @@ function testSchemaMapping() { $this->assertEqual($definition, $expected, 'Retrieved the right metadata for image.effect.image_scale'); // Most complex case, get metadata for actual configuration element. - $effects = config_typed()->get('image.style.medium')->get('effects'); + $effects = \Drupal::service('config.typed')->get('image.style.medium')->get('effects'); $definition = $effects['bddf0d06-42f9-4c75-a700-a33cafa25ea0']['data']->getDefinition(); // This should be the schema for image.effect.image_scale, reuse previous one. $expected['type'] = 'image.effect.image_scale'; @@ -139,7 +139,7 @@ function testSchemaMapping() { $this->assertEqual($definition, $expected, 'Retrieved the right metadata for the first effect of image.style.medium'); // More complex, multiple filesystem marker test. - $definition = config_typed()->getDefinition('config_test.someschema.somemodule.section_one.subsection'); + $definition = \Drupal::service('config.typed')->getDefinition('config_test.someschema.somemodule.section_one.subsection'); // This should be the schema of config_test.someschema.somemodule.*.*. $expected = array(); $expected['label'] = 'Schema multiple filesytem marker test'; @@ -151,7 +151,7 @@ function testSchemaMapping() { $this->assertEqual($definition, $expected, 'Retrieved the right metadata for config_test.someschema.somemodule.section_one.subsection'); - $definition = config_typed()->getDefinition('config_test.someschema.somemodule.section_two.subsection'); + $definition = \Drupal::service('config.typed')->getDefinition('config_test.someschema.somemodule.section_two.subsection'); // The other file should have the same schema. $this->assertEqual($definition, $expected, 'Retrieved the right metadata for config_test.someschema.somemodule.section_two.subsection'); } @@ -160,7 +160,7 @@ function testSchemaMapping() { * Tests metadata retrieval with several levels of %parent indirection. */ function testSchemaMappingWithParents() { - $config_data = config_typed()->get('config_test.someschema.with_parents'); + $config_data = \Drupal::service('config.typed')->get('config_test.someschema.with_parents'); // Test fetching parent one level up. $entry = $config_data->get('one_level'); @@ -198,7 +198,7 @@ function testSchemaMappingWithParents() { */ function testSchemaData() { // Try some simple properties. - $meta = config_typed()->get('system.site'); + $meta = \Drupal::service('config.typed')->get('system.site'); $property = $meta->get('name'); $this->assertTrue($property instanceof StringInterface, 'Got the right wrapper fo the site name property.'); $this->assertEqual($property->getValue(), 'Drupal', 'Got the right string value for site name data.'); @@ -224,7 +224,7 @@ function testSchemaData() { $this->assertTrue(count($values) == 3 && $values['front'] == 'user', 'Got the right property values for site page.'); // Now let's try something more complex, with nested objects. - $wrapper = config_typed()->get('image.style.large'); + $wrapper = \Drupal::service('config.typed')->get('image.style.large'); $effects = $wrapper->get('effects'); // The function is_array() doesn't work with ArrayAccess, so we use count(). @@ -237,7 +237,7 @@ function testSchemaData() { // Finally update some object using a configuration wrapper. $new_slogan = 'Site slogan for testing configuration metadata'; - $wrapper = config_typed()->get('system.site'); + $wrapper = \Drupal::service('config.typed')->get('system.site'); $wrapper->set('slogan', $new_slogan); $site_slogan = $wrapper->get('slogan'); $this->assertEqual($site_slogan->getValue(), $new_slogan, 'Successfully updated the contained configuration data'); diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module index a3246a3..0a48f46 100644 --- a/core/modules/contact/contact.module +++ b/core/modules/contact/contact.module @@ -112,7 +112,7 @@ function contact_entity_info_alter(&$entity_info) { */ function contact_entity_bundle_info() { $bundles = array(); - foreach (config_get_storage_names_with_prefix('contact.category.') as $config_name) { + foreach (\Drupal::configFactory()->listAll('contact.category.') as $config_name) { $config = \Drupal::config($config_name); $bundles['contact_message'][$config->get('id')]['label'] = $config->get('label'); } diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index aea9349..b2df66b 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -146,7 +146,7 @@ function content_translation_entity_bundle_info_alter(&$bundles) { * Implements hook_entity_field_info_alter(). */ function content_translation_entity_field_info_alter(&$info, $entity_type) { - $translation_settings = config('content_translation.settings')->get($entity_type); + $translation_settings = \Drupal::config('content_translation.settings')->get($entity_type); if ($translation_settings) { // Currently field translatability is defined per-field but we may want to diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module index 4816d0b..370046a 100644 --- a/core/modules/entity/entity.module +++ b/core/modules/entity/entity.module @@ -132,7 +132,7 @@ function entity_entity_bundle_rename($entity_type_id, $bundle_old, $bundle_new) // Rename entity displays. $entity_type = \Drupal::entityManager()->getDefinition('entity_view_display'); if ($bundle_old !== $bundle_new) { - $ids = config_get_storage_names_with_prefix('entity.view_display.' . $entity_type_id . '.' . $bundle_old . '.'); + $ids = \Drupal::configFactory()->listAll('entity.view_display.' . $entity_type_id . '.' . $bundle_old . '.'); foreach ($ids as $id) { $id = ConfigStorageController::getIDFromConfigName($id, $entity_type->getConfigPrefix()); $display = entity_load('entity_view_display', $id); @@ -146,7 +146,7 @@ function entity_entity_bundle_rename($entity_type_id, $bundle_old, $bundle_new) // Rename entity form displays. $entity_type = \Drupal::entityManager()->getDefinition('entity_form_display'); if ($bundle_old !== $bundle_new) { - $ids = config_get_storage_names_with_prefix('entity.form_display.' . $entity_type_id . '.' . $bundle_old . '.'); + $ids = \Drupal::configFactory()->listAll('entity.form_display.' . $entity_type_id . '.' . $bundle_old . '.'); foreach ($ids as $id) { $id = ConfigStorageController::getIDFromConfigName($id, $entity_type->getConfigPrefix()); $form_display = entity_load('entity_form_display', $id); @@ -164,7 +164,7 @@ function entity_entity_bundle_rename($entity_type_id, $bundle_old, $bundle_new) function entity_entity_bundle_delete($entity_type_id, $bundle) { // Remove entity displays of the deleted bundle. $entity_type = \Drupal::entityManager()->getDefinition('entity_view_display'); - $ids = config_get_storage_names_with_prefix('entity.view_display.' . $entity_type_id . '.' . $bundle . '.'); + $ids = \Drupal::configFactory()->listAll('entity.view_display.' . $entity_type_id . '.' . $bundle . '.'); foreach ($ids as &$id) { $id = ConfigStorageController::getIDFromConfigName($id, $entity_type->getConfigPrefix()); } @@ -172,7 +172,7 @@ function entity_entity_bundle_delete($entity_type_id, $bundle) { // Remove entity form displays of the deleted bundle. $entity_type = \Drupal::entityManager()->getDefinition('entity_form_display'); - $ids = config_get_storage_names_with_prefix('entity.form_display.' . $entity_type_id . '.' . $bundle . '.'); + $ids = \Drupal::configFactory()->listAll('entity.form_display.' . $entity_type_id . '.' . $bundle . '.'); foreach ($ids as &$id) { $id = ConfigStorageController::getIDFromConfigName($id, $entity_type->getConfigPrefix()); } diff --git a/core/modules/field/lib/Drupal/field/FieldInfo.php b/core/modules/field/lib/Drupal/field/FieldInfo.php index 7269567..5775477 100644 --- a/core/modules/field/lib/Drupal/field/FieldInfo.php +++ b/core/modules/field/lib/Drupal/field/FieldInfo.php @@ -58,7 +58,7 @@ class FieldInfo { * * @var \Drupal\Core\Config\ConfigFactoryInterface */ - protected $config; + protected $configFactory; /** * Lightweight map of fields across entity types and bundles. @@ -128,17 +128,17 @@ class FieldInfo { * * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend * The cache backend to use. - * @param \Drupal\Core\Config\ConfigFactory $config + * @param \Drupal\Core\Config\ConfigFactory $config_factory * The configuration factory object to use. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler class to use for invoking hooks. * @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager * The 'field type' plugin manager. */ - public function __construct(CacheBackendInterface $cache_backend, ConfigFactory $config, ModuleHandlerInterface $module_handler, FieldTypePluginManagerInterface $field_type_manager) { + public function __construct(CacheBackendInterface $cache_backend, ConfigFactory $config_factory, ModuleHandlerInterface $module_handler, FieldTypePluginManagerInterface $field_type_manager) { $this->cacheBackend = $cache_backend; $this->moduleHandler = $module_handler; - $this->config = $config; + $this->configFactory = $config_factory; $this->fieldTypeManager = $field_type_manager; } @@ -190,13 +190,13 @@ public function getFieldMap() { $map = array(); // Get fields. - foreach (config_get_storage_names_with_prefix('field.field.') as $config_id) { - $field_config = $this->config->get($config_id)->get(); + foreach ($this->configFactory->listAll('field.field.') as $config_id) { + $field_config = $this->configFactory->get($config_id)->get(); $fields[$field_config['uuid']] = $field_config; } // Get field instances. - foreach (config_get_storage_names_with_prefix('field.instance.') as $config_id) { - $instance_config = $this->config->get($config_id)->get(); + foreach ($this->configFactory->listAll('field.instance.') as $config_id) { + $instance_config = $this->configFactory->get($config_id)->get(); $field_uuid = $instance_config['field_uuid']; if (isset($fields[$field_uuid])) { $field = $fields[$field_uuid]; diff --git a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverviewBase.php b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverviewBase.php index 2ed54e8..a0fe179 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverviewBase.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverviewBase.php @@ -8,6 +8,7 @@ namespace Drupal\field_ui; use Drupal\Component\Plugin\PluginManagerBase; +use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\Display\EntityDisplayInterface; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Field\FieldDefinitionInterface; @@ -41,6 +42,13 @@ protected $fieldTypes; /** + * The config factory. + * + * @var \Drupal\Core\Config\ConfigFactoryInterface + */ + protected $configFactory; + + /** * Constructs a new DisplayOverviewBase. * * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager @@ -49,12 +57,15 @@ * The field type manager. * @param \Drupal\Component\Plugin\PluginManagerBase $plugin_manager * The widget or formatter plugin manager. + * @param \Drupal\Core\Config\ConfigFactory $config_factory + * The configuration factory. */ - public function __construct(EntityManagerInterface $entity_manager, FieldTypePluginManagerInterface $field_type_manager, PluginManagerBase $plugin_manager) { + public function __construct(EntityManagerInterface $entity_manager, FieldTypePluginManagerInterface $field_type_manager, PluginManagerBase $plugin_manager, ConfigFactoryInterface $config_factory) { parent::__construct($entity_manager); $this->fieldTypes = $field_type_manager->getConfigurableDefinitions(); $this->pluginManager = $plugin_manager; + $this->configFactory = $config_factory; } /** @@ -64,7 +75,8 @@ public static function create(ContainerInterface $container) { return new static( $container->get('entity.manager'), $container->get('plugin.manager.field.field_type'), - $container->get('plugin.manager.field.widget') + $container->get('plugin.manager.field.widget'), + $container->get('config.factory') ); } @@ -771,7 +783,7 @@ protected function getDisplays() { $display_entity_type = $this->getDisplayType(); $entity_type = $this->entityManager->getDefinition($display_entity_type); $config_prefix = $entity_type->getConfigPrefix(); - $ids = config_get_storage_names_with_prefix($config_prefix . '.' . $this->entity_type . '.' . $this->bundle . '.'); + $ids = $this->configFactory->listAll($config_prefix . '.' . $this->entity_type . '.' . $this->bundle . '.'); foreach ($ids as $id) { $config_id = str_replace($config_prefix . '.', '', $id); list(,, $display_mode) = explode('.', $config_id); diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index 5199bea..0ee4872 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -130,7 +130,7 @@ function menu_entity_info(&$entity_info) { */ function menu_entity_bundle_info() { $bundles = array(); - $config_names = config_get_storage_names_with_prefix('system.menu.'); + $config_names = \Drupal::configFactory()->listAll('system.menu.'); foreach ($config_names as $config_name) { $config = \Drupal::config($config_name); $bundles['menu_link'][$config->get('id')] = array( diff --git a/core/modules/node/node.install b/core/modules/node/node.install index eaa022c..a6af612 100644 --- a/core/modules/node/node.install +++ b/core/modules/node/node.install @@ -456,7 +456,7 @@ function node_install() { */ function node_uninstall() { // Delete node type variables. - $types = config_get_storage_names_with_prefix('node.type.'); + $types = \Drupal::configFactory()->listAll('node.type.'); foreach ($types as $config_name) { $type = \Drupal::config($config_name)->get('type'); \Drupal::config('language.settings')->clear('node. ' . $type . '.language.default_configuration')->save(); diff --git a/core/modules/node/node.module b/core/modules/node/node.module index c1b67b0..e83fafa 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -343,7 +343,7 @@ function node_type_get_names() { // Not using node_type_get_types() or entity_load_multiple() here, to allow // this function being used in hook_entity_info() implementations. // @todo Consider to convert this into a generic config entity helper. - $config_names = config_get_storage_names_with_prefix('node.type.'); + $config_names = \Drupal::configFactory()->listAll('node.type.'); $names = array(); foreach ($config_names as $config_name) { $config = \Drupal::config($config_name); @@ -1842,9 +1842,9 @@ function node_modules_installed($modules) { */ function node_modules_uninstalled($modules) { // Remove module-specific settings from all node types. - $config_names = config_get_storage_names_with_prefix('node.type.'); + $config_names = \Drupal::configFactory()->listAll('node.type.'); foreach ($config_names as $config_name) { - $config = config($config_name); + $config = \Drupal::config($config_name); $changed = FALSE; foreach ($modules as $module) { if ($config->get('settings.' . $module)) { diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php index c6ca292..26f793d 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php @@ -44,7 +44,7 @@ function testMappingCreation() { // Save bundle mapping config. rdf_get_mapping($this->entity_type, $this->bundle)->save(); // Test that config file was saved. - $mapping_config = config_get_storage_names_with_prefix('rdf.mapping.'); + $mapping_config = \Drupal::configFactory()->listAll('rdf.mapping.'); $this->assertTrue(in_array($mapping_config_name, $mapping_config), 'Rdf mapping config saved.'); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php index 582ad5b..c668fe9 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/InstallTest.php @@ -58,7 +58,7 @@ public function testDrupalWriteRecord() { */ public function testEnableUserTwice() { \Drupal::moduleHandler()->install(array('user'), FALSE); - $this->assertIdentical(config('system.module')->get('enabled.user'), 0); + $this->assertIdentical(\Drupal::config('system.module')->get('enabled.user'), 0); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php index 95844f6..b644c19 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleTestBase.php @@ -137,7 +137,7 @@ function assertModuleConfig($module) { * TRUE if no configuration was found, FALSE otherwise. */ function assertNoModuleConfig($module) { - $names = config_get_storage_names_with_prefix($module . '.'); + $names = \Drupal::configFactory()->listAll($module . '.'); return $this->assertFalse($names, format_string('No configuration found for @module module.', array('@module' => $module))); } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceUnitTest.php index e4e7b7b..623d995 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceUnitTest.php @@ -65,7 +65,7 @@ public function testClear() { $source .= '[bogus:token]'; // Replace with with the clear parameter, only the valid token should remain. - $target = String::checkPlain(config('system.site')->get('name')); + $target = String::checkPlain(\Drupal::config('system.site')->get('name')); $result = $this->tokenService->replace($source, array(), array('langcode' => $this->languageInterface->id, 'clear' => TRUE)); $this->assertEqual($target, $result, 'Valid tokens replaced while invalid tokens ignored.'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeSuggestionsAlterTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeSuggestionsAlterTest.php index 8f6e9b6..390687d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeSuggestionsAlterTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeSuggestionsAlterTest.php @@ -43,7 +43,7 @@ function testTemplateSuggestions() { // Enable test_theme, it contains a template suggested by theme_test.module // in theme_test_theme_suggestions_theme_test_suggestion_provided(). - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme') ->save(); @@ -59,7 +59,7 @@ function testGeneralSuggestionsAlter() { $this->assertText('Original template for testing hook_theme_suggestions_alter().'); // Enable test_theme and test that themes can alter template suggestions. - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme') ->save(); $this->drupalGet('theme-test/general-suggestion-alter'); @@ -80,7 +80,7 @@ function testTemplateSuggestionsAlter() { $this->assertText('Original template for testing hook_theme_suggestions_HOOK_alter().'); // Enable test_theme and test that themes can alter template suggestions. - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme') ->save(); $this->drupalGet('theme-test/suggestion-alter'); @@ -101,7 +101,7 @@ function testSpecificSuggestionsAlter() { $this->drupalGet('theme-test/specific-suggestion-alter'); $this->assertText('Template for testing specific theme calls.'); - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme') ->save(); @@ -125,7 +125,7 @@ function testThemeFunctionSuggestionsAlter() { $this->assertText('Original theme function.'); // Enable test_theme and test that themes can alter theme suggestions. - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme') ->save(); $this->drupalGet('theme-test/function-suggestion-alter'); @@ -146,7 +146,7 @@ function testThemeFunctionSuggestionsAlter() { */ function testExecutionOrder() { // Enable our test theme and module. - config('system.theme') + \Drupal::config('system.theme') ->set('default', 'test_theme') ->save(); \Drupal::moduleHandler()->install(array('theme_suggestions_test')); diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index b85cc96..4fc1dd9 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -462,7 +462,7 @@ function taxonomy_vocabulary_get_names() { if (!isset($names)) { $names = array(); - $config_names = config_get_storage_names_with_prefix('taxonomy.vocabulary.'); + $config_names = \Drupal::configFactory()->listAll('taxonomy.vocabulary.'); foreach ($config_names as $config_name) { $id = substr($config_name, strlen('taxonomy.vocabulary.')); $names[$id] = $id;