repatched domain_site_settings
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
diff --git a/domain_site_settings.services.yml b/domain_site_settings.services.yml
|
||||
index 65e9113..6ebd87d 100644
|
||||
--- a/domain_site_settings.services.yml
|
||||
+++ b/domain_site_settings.services.yml
|
||||
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
domain_site_settings.overrider:
|
||||
class: \Drupal\domain_site_settings\Configuration\DomainConfigOverride
|
||||
- arguments: ['@domain.negotiator', '@config.factory']
|
||||
+ arguments: ['@config.factory']
|
||||
tags:
|
||||
- {name: config.factory.override, priority: 5}
|
||||
diff --git a/src/Configuration/DomainConfigOverride.php b/src/Configuration/DomainConfigOverride.php
|
||||
index 272e052..8497e2a 100644
|
||||
--- a/src/Configuration/DomainConfigOverride.php
|
||||
+++ b/src/Configuration/DomainConfigOverride.php
|
||||
@@ -16,13 +16,6 @@ use Drupal\Core\Config\ConfigFactoryInterface;
|
||||
class DomainConfigOverride implements ConfigFactoryOverrideInterface {
|
||||
|
||||
/**
|
||||
- * The Domain negotiator.
|
||||
- *
|
||||
- * @var \Drupal\domain\DomainNegotiatorInterface
|
||||
- */
|
||||
- protected $negotiator;
|
||||
-
|
||||
- /**
|
||||
* The config factory.
|
||||
*
|
||||
* @var \Drupal\Core\Config\ConfigFactoryInterface
|
||||
@@ -32,15 +25,10 @@ class DomainConfigOverride implements ConfigFactoryOverrideInterface {
|
||||
/**
|
||||
* Constructs a DomainSourcePathProcessor object.
|
||||
*
|
||||
- * @param \Drupal\domain\DomainNegotiatorInterface $negotiator
|
||||
- * The domain negotiator.
|
||||
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
|
||||
* The module handler service.
|
||||
*/
|
||||
- public function __construct(
|
||||
- DomainNegotiatorInterface $negotiator,
|
||||
- ConfigFactoryInterface $config_factory) {
|
||||
- $this->negotiator = $negotiator;
|
||||
+ public function __construct(ConfigFactoryInterface $config_factory) {
|
||||
$this->configFactory = $config_factory;
|
||||
}
|
||||
|
||||
@@ -57,7 +45,9 @@ class DomainConfigOverride implements ConfigFactoryOverrideInterface {
|
||||
public function loadOverrides($names = []) {
|
||||
$overrides = [];
|
||||
if (in_array('system.site', $names)) {
|
||||
- $domain = $this->negotiator->getActiveDomain();
|
||||
+ /* @var \Drupal\domain\DomainNegotiator $negotiator */
|
||||
+ $negotiator = \Drupal::service('domain.negotiator');
|
||||
+ $domain = $negotiator->getActiveDomain();
|
||||
if (!empty($domain)) {
|
||||
$domain_key = $domain->id();
|
||||
$configFactory = $this->configFactory->get('domain_site_settings.domainconfigsettings');
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
domain_site_settings.overrider:
|
||||
class: \Drupal\domain_site_settings\Configuration\DomainConfigOverride
|
||||
arguments: ['@domain.negotiator', '@config.factory']
|
||||
arguments: ['@config.factory']
|
||||
tags:
|
||||
- {name: config.factory.override, priority: 5}
|
||||
|
||||
+4
-14
@@ -15,13 +15,6 @@ use Drupal\Core\Config\ConfigFactoryInterface;
|
||||
*/
|
||||
class DomainConfigOverride implements ConfigFactoryOverrideInterface {
|
||||
|
||||
/**
|
||||
* The Domain negotiator.
|
||||
*
|
||||
* @var \Drupal\domain\DomainNegotiatorInterface
|
||||
*/
|
||||
protected $negotiator;
|
||||
|
||||
/**
|
||||
* The config factory.
|
||||
*
|
||||
@@ -32,15 +25,10 @@ class DomainConfigOverride implements ConfigFactoryOverrideInterface {
|
||||
/**
|
||||
* Constructs a DomainSourcePathProcessor object.
|
||||
*
|
||||
* @param \Drupal\domain\DomainNegotiatorInterface $negotiator
|
||||
* The domain negotiator.
|
||||
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
|
||||
* The module handler service.
|
||||
*/
|
||||
public function __construct(
|
||||
DomainNegotiatorInterface $negotiator,
|
||||
ConfigFactoryInterface $config_factory) {
|
||||
$this->negotiator = $negotiator;
|
||||
public function __construct(ConfigFactoryInterface $config_factory) {
|
||||
$this->configFactory = $config_factory;
|
||||
}
|
||||
|
||||
@@ -57,7 +45,9 @@ class DomainConfigOverride implements ConfigFactoryOverrideInterface {
|
||||
public function loadOverrides($names = []) {
|
||||
$overrides = [];
|
||||
if (in_array('system.site', $names)) {
|
||||
$domain = $this->negotiator->getActiveDomain();
|
||||
/* @var \Drupal\domain\DomainNegotiator $negotiator */
|
||||
$negotiator = \Drupal::service('domain.negotiator');
|
||||
$domain = $negotiator->getActiveDomain();
|
||||
if (!empty($domain)) {
|
||||
$domain_key = $domain->id();
|
||||
$configFactory = $this->configFactory->get('domain_site_settings.domainconfigsettings');
|
||||
|
||||
Reference in New Issue
Block a user