You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And the wp-includes/blocks/post-author/editor.css file should not exist
506
506
And the wp-includes/blocks/post-author/editor.min.css file should not exist
507
+
508
+
@require-php-7.0@require-wp-6.1
509
+
Scenario: Attempting to downgrade without --force shows helpful message
510
+
Given a WP install
511
+
512
+
When I run `wp core version`
513
+
Then save STDOUT as {WP_CURRENT_VERSION}
514
+
515
+
When I try `wp core update --version=6.0`
516
+
Then STDOUT should contain:
517
+
"""
518
+
WordPress is up to date at version
519
+
"""
520
+
And STDOUT should contain:
521
+
"""
522
+
is older than the current version
523
+
"""
524
+
And STDOUT should contain:
525
+
"""
526
+
Use --force to update anyway
527
+
"""
528
+
And STDOUT should not contain:
529
+
"""
530
+
Success:
531
+
"""
532
+
And the return code should be 0
533
+
534
+
When I run `wp core update --version=6.0 --force`
535
+
Then STDOUT should contain:
536
+
"""
537
+
Updating to version 6.0
538
+
"""
539
+
And STDOUT should contain:
540
+
"""
541
+
Success: WordPress updated successfully.
542
+
"""
543
+
544
+
Scenario: Show helpful tip when update is locked
545
+
Given a WP install
546
+
547
+
When I run `wp option update core_updater.lock 100000000000000`
548
+
And I try `wp core update --version=trunk`
549
+
Then STDERR should contain:
550
+
"""
551
+
Another update is currently in progress. You may need to run `wp option delete core_updater.lock` after verifying another update isn't actually running.
@@ -695,7 +716,7 @@ function wp_new_blog_notification() {
695
716
$args['locale']
696
717
);
697
718
698
-
if ( ! empty( $GLOBALS['wpdb']->last_error ) ) {
719
+
if ( ! empty( $wpdb->last_error ) ) {
699
720
WP_CLI::error( 'Installation produced database errors, and may have partially or completely failed.' );
700
721
}
701
722
@@ -1243,7 +1264,12 @@ static function () {
1243
1264
if ( is_wp_error( $result ) ) {
1244
1265
$message = WP_CLI::error_to_string( $result );
1245
1266
if ( 'up_to_date' !== $result->get_error_code() ) {
1246
-
WP_CLI::error( $message );
1267
+
// Check if the error is related to the core_updater.lock
1268
+
if ( self::is_lock_error( $result ) ) {
1269
+
WP_CLI::error( rtrim( $message, '.' ) . '. You may need to run `wp option delete core_updater.lock` after verifying another update isn\'t actually running.' );
// Requested version is older than current (downgrade attempt)
1310
+
WP_CLI::log( "WordPress is up to date at version {$wp_version}." );
1311
+
WP_CLI::log( 'The version you requested (' . Utils\get_flag_value( $assoc_args, 'version' ) . ") is older than the current version ({$wp_version})." );
1312
+
WP_CLI::log( 'Use --force to update anyway (e.g., to downgrade to version ' . Utils\get_flag_value( $assoc_args, 'version' ) . ').' );
1281
1313
} else {
1282
-
WP_CLI::success( 'WordPress is up to date.' );
1314
+
WP_CLI::success( "WordPress is up to date at version {$wp_version}." );
0 commit comments