Skip to content

Commit

Permalink
#4194: drush config:status does not respect excluded modules (#4201)
Browse files Browse the repository at this point in the history
* Update ConfigCommands.php

* Update drush.services.yml
  • Loading branch information
JTubex authored and weitzman committed Oct 3, 2019
1 parent 968890e commit 11cc24b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
30 changes: 28 additions & 2 deletions src/Drupal/Commands/config/ConfigCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class ConfigCommands extends DrushCommands implements StdinAwareInterface
*/
protected $configFactory;

/**
* @var StorageInterface
*/
protected $configStorageExport;

/**
* @return ConfigFactoryInterface
*/
Expand All @@ -44,11 +49,32 @@ public function getConfigFactory()
/**
* ConfigCommands constructor.
* @param ConfigFactoryInterface $configFactory
* @param \Drupal\Core\Config\StorageInterface $configStorage
*/
public function __construct($configFactory)
public function __construct($configFactory, StorageInterface $configStorage)
{
parent::__construct();
$this->configFactory = $configFactory;
$this->configStorage = $configStorage;
}

/**
* @param \Drupal\Core\Config\StorageInterface $exportStorage
*/
public function setExportStorage(StorageInterface $exportStorage)
{
$this->configStorageExport = $exportStorage;
}

/**
* @return StorageInterface
*/
public function getConfigStorageExport()
{
if (isset($this->configStorageExport)) {
return $this->configStorageExport;
}
return $this->configStorage;
}

/**
Expand Down Expand Up @@ -333,7 +359,7 @@ public static function getDirectory($label, $directory = null)
public function getChanges($target_storage)
{
/** @var StorageInterface $active_storage */
$active_storage = \Drupal::service('config.storage');
$active_storage = $this->getConfigStorageExport();

$config_comparer = new StorageComparer($active_storage, $target_storage, \Drupal::service('config.manager'));

Expand Down
4 changes: 3 additions & 1 deletion src/Drupal/Commands/config/drush.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
services:
config.commands:
class: \Drush\Drupal\Commands\config\ConfigCommands
arguments: ['@config.factory']
arguments: ['@config.factory', '@config.storage']
calls:
- [setExportStorage, ['@?config.storage.export']]
tags:
- { name: drush.command }
config.export.commands:
Expand Down

0 comments on commit 11cc24b

Please sign in to comment.