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

[BUGS-5759] Adjust logic for checking for options table #137

Merged
merged 5 commits into from
Feb 27, 2023
Merged

Conversation

jspellman814
Copy link
Contributor

Addresses #136 where customers use a custom DB prefix without a trailing _.

@jspellman814 jspellman814 requested a review from a team as a code owner February 22, 2023 16:48
@pwtyler
Copy link
Member

pwtyler commented Feb 22, 2023

If we're specifically looking for the wp_options table, (as opposed to say, wp_mycustompluginoptions), can we use the global $table_prefix + options instead of a preg_match?

@jspellman814 jspellman814 changed the title [BUGS-5759] Remove underscore before options [BUGS-5759] Adjust logic for checking for options table Feb 24, 2023
Co-authored-by: Phil Tyler <philip@tylerdigital.com>
@jspellman814
Copy link
Contributor Author

jspellman814 commented Feb 24, 2023

I was able to test this change successfully on my local machine via lando wp. Steps taken:

  1. Start lando container on local site: lando start
  2. Install wp_launch_check package: lando wp package install pantheon-systems/wp_launch_check
  3. Run lando wp launchcheck database to get baseline test.
  4. SSH into container: lando ssh
  5. cd to directory containing the file that needs to be edited: cd /var/www/.wp-cli/packages/vendor/pantheon-systems/wp_launch_check/php/pantheon/checks/
  6. Remove current database.php file and create new one with contents from this PR: rm database.php, cat > database.php and then paste the contents of the file from this branch.
  7. Confirm update by running lando wp launchcheck database

Database check prior to change:

Screenshot 2023-02-24 at 12 26 57 PM

Database check after change (note the new conditional!! text):

Screenshot 2023-02-24 at 12 23 02 PM

I also changed the table prefix and am seeing the same results. Going to test this on the platform as per CONTRIBUTING.md. Assuming that goes well, this will be merged and deployed next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants