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

Fix issues with feature activation during install #2734

Merged
merged 6 commits into from
May 3, 2022
Merged

Conversation

JakePT
Copy link
Contributor

@JakePT JakePT commented May 2, 2022

Description of the Change

This change fixes two issues:

  1. If no features were selected installation would not proceed, but without any feedback (BUG: Installation Workflow and initial sync #2706).

The fix is that if no features are selected the user is asked to confirm, and if they do install is skipped with the same behaviour as following the Skip Install link. Additionally, when skipping installation any features that are activated automatically are deactivated so that skipping installation results in no active features.

  1. If a feature that is activated by default is deselected during installation it would be activated anyway.

This is fixed by deactivating any features that can be selected during install if they are not selected. This is necessary as certain features are activated by default before installation has even started.

Verification Process

Before each test clear all ElasticPress settings from the database for a fresh install. Each test should also be repeated for a multisite network activation.

  1. When prompted to enter host settings click "Skip Install". You should be taken to the Features page where no Features are active but enabling them is disabled until host settings are entered.

  1. When prompted to enter host settings, click the button to go to Settings and enter the appropriate settings.
  2. When prompted to select features click "Skip Install". You should be taken to the Features page where no Features are active.

  1. When prompted to enter host settings, click the button to go to Settings and enter the appropriate settings.
  2. When prompted to select features deselect all features and click "Save Features". You should be prompted with a dialog box asking you to confirm.
  3. On cancelling the dialog box should close and nothing else should happen.
  4. On confirming that you want to proceed you should be taken to the Features page where no Features are active.

  1. When prompted to enter host settings, click the button to go to Settings and enter the appropriate settings.
  2. When prompted to select features, deselect one of the features that are already selected and select a feature that isn't already selected. Click "Save Features". You should be prompted to index content.
  3. When prompted to index content, click "Skip Install". You should You should be taken to the Features page where he selected features should match what was selected during install i.e. the selected feature should be active, and the deselected feature shouldn't be.

  1. When prompted to enter host settings, click the button to go to Settings and enter the appropriate settings.
  2. When prompted to select features, deselect one of the features that are already selected and select a feature that isn't already selected. Click "Save Features". You should be prompted to index content.
  3. On indexing content you should be taken to the Sync page and a Sync should start.
  4. After sync is complete, visit the Features page. The selected features should match what was selected during install.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

  • Fixed - An issue where selecting no features during install would just cause the install page to reload without any feedback.
  • Fixed - An issue where deselecting a feature during install would not stop that feature from being activated.

Credits

Props @JakePT

@JakePT JakePT requested a review from felipeelia May 2, 2022 13:11
@JakePT JakePT self-assigned this May 2, 2022
@JakePT JakePT changed the title Fix issues with feature activation during install. Fix issues with feature activation during install May 2, 2022
@JakePT
Copy link
Contributor Author

JakePT commented May 2, 2022

Note that this addresses one of the issues in #2706, but not the other one, so it does not close that issue.

@felipeelia felipeelia added this to the 4.2.0 milestone May 2, 2022
@felipeelia
Copy link
Member

@JakePT do you think it would be possible to add some tests for this?

@felipeelia felipeelia merged commit a6f3c51 into develop May 3, 2022
@felipeelia felipeelia deleted the fix/2706 branch May 3, 2022 17:43
@felipeelia felipeelia mentioned this pull request May 3, 2022
46 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants