Skip to content

Add a --skip-config flag to wp core multisite-convert#231

Merged
danielbachhuber merged 2 commits intowp-cli:mainfrom
hbhalodia:feat/patch-178
May 24, 2023
Merged

Add a --skip-config flag to wp core multisite-convert#231
danielbachhuber merged 2 commits intowp-cli:mainfrom
hbhalodia:feat/patch-178

Conversation

@hbhalodia
Copy link
Contributor

Issue

Solution

  • Have added the --skip-config parameter to subcommand function doc block.
  • This enables the command to use --skip-config.
  • Only adding this parameter to comment works as needed on issue as the multisite-install and multisite-convert command have a common function multisite_convert_( $assoc_args ) which have a check for this parameter and then proceed accordingly.

Screenshot for command executed after the patch:

Screenshot 2023-05-22 at 7 57 35 PM

Provided the support to skip the configuration of wp-config file by passing the --skip-config associate param. This is already being added for multiiste install command.
@hbhalodia hbhalodia requested a review from a team as a code owner May 22, 2023 14:28
@swissspidy
Copy link
Member

Thanks a lot for your PR! Convenient that this argument is automatically handled further down 😃

Could you perhaps also add a Behat test confirming that this works as expected?

It could look like the existing test for wp core multisite-install:

Scenario: Install WordPress multisite without adding multisite constants to wp-config file
Given an empty directory
And WP files
And wp-config.php
And a database
When I run `wp core multisite-install --url=foobar.org --title=Test --admin_user=wpcli --admin_email=admin@example.com --admin_password=password --skip-config`
Then STDOUT should contain:
"""
Addition of multisite constants to 'wp-config.php' skipped. You need to add them manually:
"""

The new test can be added at the end of the features/core.feature file, after the other multisite-convert tests.

@hbhalodia
Copy link
Contributor Author

Thanks, @swissspidy I Would add this soon.

@hbhalodia
Copy link
Contributor Author

Hi @swissspidy, have added the behat test for the same. Can you please review and let me know if anything else needed? Thanks a lot for review.

@danielbachhuber danielbachhuber changed the title Feat: provide support to skip config for multisite convert Add a --skip-config flag to wp core multisite-convert May 24, 2023
@danielbachhuber danielbachhuber self-requested a review May 24, 2023 10:45
@danielbachhuber danielbachhuber added command:core-multisite-convert Related to 'core multisite-convert' command command:core Related to 'core' command labels May 24, 2023
@danielbachhuber danielbachhuber added this to the 2.1.12 milestone May 24, 2023
@danielbachhuber danielbachhuber merged commit e5b4c5b into wp-cli:main May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:core Related to 'core' command command:core-multisite-convert Related to 'core multisite-convert' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants