Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX-3042: toggle:modules should use normal environment detection #4295

Merged
merged 1 commit into from
Dec 11, 2020

Conversation

danepowell
Copy link
Contributor

Motivation

The toggle modules command uses custom environment detection. This can produce unexpected results compared to other commands that use BLT core environment detection.

Proposed changes

Rely on core environment detection by just checking the environment config.

@danepowell danepowell merged commit 9fedc00 into acquia:12.x Dec 11, 2020
@danepowell danepowell added 12.x Affects or applies to 12.x Bug Something isn't working labels Dec 11, 2020
@shelane
Copy link
Contributor

shelane commented Jan 6, 2021

So now when this is called in the context of another command that has the environment passed in as an argument, it reads all environments as "local" instead of the argument.

         try {
            $commands = ['internal:drupal:install'];
            $strategy = $this->getConfigValue('cm.strategy');
            if (in_array($strategy, ['core-only', 'config-split', 'features'])) {
              $commands[] = 'drupal:config:import';
            }
            $commands[] = 'llnl:site:content';
            $commands[] = 'drupal:toggle:modules';
            $this->invokeCommands($commands);
          }
          catch (BltException $e) {
            $this->say('<comment>Note:</comment> file permission error on Acquia Cloud can be safely ignored.');
          }

How exactly should I set the "config" per environment? (I only had the problem when moving from BLT 11.6.0 to 12.5.1)

@shelane
Copy link
Contributor

shelane commented Jan 6, 2021

BTW, the comments for this command were not changed with this update:

   * You may define the environment for which modules should be toggled by
   * passing the --environment=[value] option to this command, setting the
   * 'environnment' environment variable, or defining environment in one of your
   * BLT configuration files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
12.x Affects or applies to 12.x Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants