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

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

Merged
merged 2 commits into from
May 24, 2023

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 May 24, 2023
@danielbachhuber danielbachhuber self-requested a review May 24, 2023 10:45
@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
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment