wp-cli / search-replace-command

Searches/replaces strings in the database.
MIT License
57 stars 45 forks source link

6.1 Beta 1 Compatibility with search-replace #173

Closed vikasprogrammer closed 1 year ago

vikasprogrammer commented 1 year ago

Bug Report

Describe the current, buggy behavior

I ran this command on WP 6.1 Beta 1 core and observed an exception.

wp search-replace "source.instawp.xyz" "dest.instawp.xyz"

Fatal error: Uncaught Error: Call to undefined function WP_CLI\Utils\global_terms_enabled() in phar:///RunCloud/Packages/RunCloudAgent/bin/wp-cli/vendor/wp-cli/wp-cli/php/utils-wp.php:413
Stack trace:
#0 phar:///RunCloud/Packages/RunCloudAgent/bin/wp-cli/vendor/wp-cli/search-replace-command/src/Search_Replace_Command.php(325): WP_CLI\Utils\wp_get_table_names()
#1 [internal function]: Search_Replace_Command->__invoke()
#2 phar:///RunCloud/Packages/RunCloudAgent/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func()
#3 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}()
#4 phar:///RunCloud/Packages/RunCloudAgent/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func()
#5 phar:///RunCloud/Packages/RunCloudAgent/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(417): WP_CLI\Dispatcher\Subcommand->invoke()
#6 phar:///RunCloud/Packages/RunCloudAgent/bin/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(440): WP_CLI\R in phar:///RunCloud/Packages/RunCloudAgent/bin/wp-cli/vendor/wp-cli/wp-cli/php/utils-wp.php on line 413
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

Describe how other contributors can replicate this bug

Describe what you would expect as the correct outcome

It should have shown the replacements in a tabular format.

Let us know what environment you are running this on

OS:     Linux #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022
Shell:  /bin/bash
PHP binary:     /path/php74/bin/php
PHP version:    7.4.30
php.ini used:   /etc/php74/php.ini
MySQL binary:   /usr/bin/mysql
MySQL version:  mysql  Ver 15.1 Distrib 10.4.26-MariaDB
SQL modes:      STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /home/tekosiyuradonedo/webapps/wigaho
WP-CLI packages dir:    /root/.wp-cli/packages/
WP-CLI global config:   /root/.wp-cli/config.yml
WP-CLI project config:  
WP-CLI version: 2.6.0

Provide a possible solution

Not sure how to fix this bug.

dream-encode commented 1 year ago

Cause: https://core.trac.wordpress.org/changeset/54240

desrosj commented 1 year ago

This should be resolved by https://core.trac.wordpress.org/changeset/54283. It will be included in beta 2 next week.

vikasprogrammer commented 1 year ago

Thanks for quick resolution. Closing now.

oxyc commented 1 year ago

Heads up since it wasnt referenced here, on WP 6.1.1, this required WP-CLI to be updated from 2.6.0 to 2.7.1 as well