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

Fatal error in wp-migrate-db-pro-compatibility.php #143

Open
rosswintle opened this issue Dec 12, 2022 · 3 comments
Open

Fatal error in wp-migrate-db-pro-compatibility.php #143

rosswintle opened this issue Dec 12, 2022 · 3 comments

Comments

@rosswintle
Copy link

Hi folks,

This may be related to #128. And it's a weird edge case, so probably low priority.

I have a local dev server with an old verson of Migrate Pro (v2.0.2)

I wanted to test something with Migrate Lite, so I disabled Pro and installed the current versions of Migrate Lite from the repo (v2.5.0)

When I visited the settings page it installed wp-migrate-db-pro-compatibility.php in my mu-plugins folder.

This then fatal-errored with:

Fatal error: Uncaught Error: Call to undefined method DeliciousBrains\WPMDB\Common\Compatibility\Compatibility::register() in <path>/wp-content/mu-plugins/wp-migrate-db-pro-compatibility.php:45
Stack trace:
#0 <path>/wp-settings.php(372): include_once() 
#1 <path>/wp-config.php(78): require_once('/Users/rosswint...') 
#2 <path>/wp-load.php(50): require_once('/Users/rosswint...') 
#3 <path>/wp-admin/admin.php(34): require_once('/Users/rosswint...') 
#4 <path>/wp-admin/tools.php(40): require_once('/Users/rosswint...') 
#5 /Users/<username>/.composer/vendor/laravel/valet/server.php(234): require('/Users/<username>...') 
#6 {main}
thrown in /Users/rosswintle/db/migrate-test/wp-content/mu-plugins/wp-migrate-db-pro-compatibility.php on line 45

I can repeatedly recreate this in this WordPress install by:

  • Deleting the wp-migrate-db-pro-compatibility.php file
  • Deactivate WP Migrate Lite plugin
  • Activate WPMigrate Lite plugin
  • Visit Tools -> WP Migrate (this re-creates the wp-migrate-db-pro-compatibility.php file
  • Load any page - site now fatals

I've not got time to dig into code and figure out what's going on. But hopefully this report is useful.

@rosswintle
Copy link
Author

rosswintle commented Dec 12, 2022

As a follow up, I've just updated and I don't see this issue with Pro v2.5.0 and Lite v2.5.0

It looks like the Lite compatibility file isn't compatible with older versions of Pro.

I'm not sure why anyone other than me would have Lite installed alongside an old version of Pro, but seems like something we could check for and not fatal on.

@philwp
Copy link
Collaborator

philwp commented Dec 12, 2022

@rosswintle we changed the way that we call the compatibility plugin as part of some security tightening to the plugin.

If you delete the wp-migrate-db-compatibiity.php file from the mu-plugins dir and then reactivate the older version of the plugin, it will regenerate the compatibility plugin that works with the older version. This should only be an issue if the versions are on either side of 2.3.4 as this is when we made this change.

@rosswintle
Copy link
Author

Fair enough. It's pretty edge-casey.

I've fixed my issue.

I reported this in case you wanted to add a test for the existence of the class/method before calling it and thus avert a fatal.

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

No branches or pull requests

2 participants