diff --git a/core/includes/config.inc b/core/includes/config.inc index e4fb08f..71b4ab9 100644 --- a/core/includes/config.inc +++ b/core/includes/config.inc @@ -5,7 +5,6 @@ use Drupal\Core\Config\ConfigException; use Drupal\Core\Language\Language; use Drupal\Core\Config\ExtensionInstallStorage; -use Drupal\Core\Config\Context\FreeConfigContext; use Drupal\Core\Config\FileStorage; use Drupal\Core\Config\StorageInterface; use Drupal\Core\Entity\EntityTypeInterface; diff --git a/core/lib/Drupal/Core/Config/ConfigFactory.php b/core/lib/Drupal/Core/Config/ConfigFactory.php index 1ca26e8..8aeb301 100644 --- a/core/lib/Drupal/Core/Config/ConfigFactory.php +++ b/core/lib/Drupal/Core/Config/ConfigFactory.php @@ -96,16 +96,24 @@ public function __construct(StorageInterface $storage, EventDispatcher $event_di /** * Disable overrides when loading configuration objects. + * + * @return \Drupal\Core\Config\ConfigFactory + * The config factory object. */ public function disableOverrides() { $this->useOverrides = FALSE; + return $this; } /** * Enable overrides when loading configuration objects. + * + * @return \Drupal\Core\Config\ConfigFactory + * The config factory object. */ public function enableOverrides() { $this->useOverrides = TRUE; + return $this; } /** diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php index 67f7f1d..5a077fb 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php @@ -61,8 +61,7 @@ function testConfOverride() { $this->assertFalse(isset($data['baz'])); $this->assertIdentical($data['404'], $expected_original_data['404']); - // Get the configuration object in an overriden context (the one set by - // default). + // Get the configuration object in with overrides. $config = \Drupal::config('config_test.system'); // Verify that it contains the overridden data from $conf. diff --git a/core/modules/search/lib/Drupal/search/SearchPageListController.php b/core/modules/search/lib/Drupal/search/SearchPageListController.php index 61b17d9..6f86728 100644 --- a/core/modules/search/lib/Drupal/search/SearchPageListController.php +++ b/core/modules/search/lib/Drupal/search/SearchPageListController.php @@ -9,7 +9,6 @@ use Drupal\Component\Utility\MapArray; use Drupal\Core\Config\ConfigFactory; -use Drupal\Core\Config\Context\ContextInterface; use Drupal\Core\Config\Entity\DraggableListController; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; @@ -57,15 +56,10 @@ class SearchPageListController extends DraggableListController implements FormIn * The module handler to invoke hooks on. * @param \Drupal\Core\Config\ConfigFactory $config_factory * The factory for configuration objects. - * @param \Drupal\Core\Config\Context\ContextInterface $context - * The configuration context to use. */ - public function __construct(EntityTypeInterface $entity_info, EntityStorageControllerInterface $storage, SearchPluginManager $search_manager, ModuleHandlerInterface $module_handler, ConfigFactory $config_factory, ContextInterface $context) { + public function __construct(EntityTypeInterface $entity_info, EntityStorageControllerInterface $storage, SearchPluginManager $search_manager, ModuleHandlerInterface $module_handler, ConfigFactory $config_factory) { parent::__construct($entity_info, $storage, $module_handler); - $this->configFactory = $config_factory; - $this->configFactory->enterContext($context); - $this->searchManager = $search_manager; } @@ -78,8 +72,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI $container->get('entity.manager')->getStorageController($entity_info->id()), $container->get('plugin.manager.search'), $container->get('module_handler'), - $container->get('config.factory'), - $container->get('config.context.free') + $container->get('config.factory') ); } @@ -149,7 +142,8 @@ public function buildRow(EntityInterface $entity) { */ public function buildForm(array $form, array &$form_state) { $form = parent::buildForm($form, $form_state); - $search_settings = $this->configFactory->get('search.settings'); + $search_settings = $this->configFactory->disableOverrides()->get('search.settings'); + $this->configFactory->enableOverrides(); // Collect some stats. $remaining = 0; $total = 0;