Skip to content
Snippets Groups Projects
Commit 47fbd657 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1932336 by damiankloip: Use override free configuration context for SystemConfigFormBase.

parent 4ac059e5
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -10,6 +10,7 @@
use Drupal\Core\Form\FormInterface;
use Drupal\Core\ControllerInterface;
use Drupal\Core\Config\ConfigFactory;
use Drupal\Core\Config\Context\ContextInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......@@ -29,9 +30,12 @@ abstract class SystemConfigFormBase implements FormInterface, ControllerInterfac
*
* @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(ConfigFactory $config_factory) {
public function __construct(ConfigFactory $config_factory, ContextInterface $context) {
$this->configFactory = $config_factory;
$this->configFactory->enterContext($context);
}
/**
......@@ -39,7 +43,8 @@ public function __construct(ConfigFactory $config_factory) {
*/
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory')
$container->get('config.factory'),
$container->get('config.context.free')
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment