Closed Tofandel closed 1 year ago
@Tofandel Can you add a test for this PR that trigger the above error and asserts that the change fixes it?
How can I do that? The tests in this repo don't seem to have an environment?! I'd need to register a class with a protected property serialize it and then run the search replace command
Proceeding with https://github.com/wp-cli/wp-cli/issues/5594 for this repository. I've captured this PR to https://gist.github.com/danielbachhuber/3d3d6396cd96c88761dd3171b2d6981b in case this PR is auto-closed or broken in some way.
Example: PHP Fatal error: Uncaught Error: Cannot access protected property WCML_Currency_Switcher_Template::$custom_filters in phar:///usr/local/bin/wp/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php:105 Stack trace:
0 phar:///usr/local/bin/wp/vendor/wp-cli/search-replace-command/src/WP_CLI/SearchReplacer.php(92): WP_CLI\SearchReplacer->run_recursively(Object(WCML_Currency_Switcher_Template), false, 2, Array)