Skip to content

Commit

Permalink
ACMS-4333: Fixed the bug reported in D11.
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalkhode1 committed Nov 19, 2024
1 parent 691c63f commit 6ac1a5b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Config/DefaultDrushConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function __construct(?DrushConfig $config = NULL) {
}
$this->set('drush.bin', $config->get("runtime.drush-script"));
$this->setDefault('drush.alias', "self");
$this->setDefault('drush.uri', $config->get('options.uri'));
$this->combine($config->export());
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Drush/Commands/BaseDrushCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function switchSiteContext(string $site_name): void {
*/
protected function initializeConfig(string $site_name = ""): void {
$config = new DefaultDrushConfig($this->getConfig());
$configInitializer = new ConfigInitializer($config, $this->input());
$configInitializer = new ConfigInitializer($config);
if ($site_name) {
$configInitializer->setSite($site_name);
}
Expand Down
17 changes: 16 additions & 1 deletion src/Robo/Config/ConfigAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,29 @@

namespace Acquia\Drupal\RecommendedSettings\Robo\Config;

use Acquia\Drupal\RecommendedSettings\Config\ConfigInitializer;
use Acquia\Drupal\RecommendedSettings\Config\DefaultDrushConfig;
use Drush\Config\ConfigAwareTrait as DrushConfigAwareTrait;
use Drush\Config\DrushConfig;

/**
* Adds custom methods to DrushConfigAwareTrait.
*/
trait ConfigAwareTrait {

use DrushConfigAwareTrait;
use DrushConfigAwareTrait {
DrushConfigAwareTrait::getConfig as parentDrushGetConfig;
}

/**
* {@inheritdoc}
*/
public function getConfig(): DrushConfig {
if (!$this->config instanceof DefaultDrushConfig) {
$this->config = new DefaultDrushConfig($this->parentDrushGetConfig());
}
return $this->config;
}

/**
* {@inheritdoc}
Expand Down
2 changes: 2 additions & 0 deletions src/Robo/Tasks/DrushTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Acquia\Drupal\RecommendedSettings\Robo\Tasks;

use Acquia\Drupal\RecommendedSettings\Robo\Config\ConfigAwareTrait;
use Robo\Common\CommandArguments;
use Robo\Exception\TaskException;
use Robo\Task\CommandStack;
Expand All @@ -22,6 +23,7 @@
*/
class DrushTask extends CommandStack {

use ConfigAwareTrait;
use CommandArguments {
option as traitOption;
}
Expand Down

0 comments on commit 6ac1a5b

Please sign in to comment.