Merge pull request #27696 from woocommerce/fix/version-race-conditions

Fix some race conditions in WC_Install
This commit is contained in:
Claudio Sanches 2020-10-14 20:18:47 -03:00 committed by GitHub
commit e34681dbb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 6 deletions

View File

@ -252,7 +252,6 @@ class WC_Admin_Notices {
include dirname( __FILE__ ) . '/views/html-notice-update.php';
}
} else {
WC_Install::update_db_version();
include dirname( __FILE__ ) . '/views/html-notice-updated.php';
}
}

View File

@ -272,7 +272,6 @@ class WC_Notes_Run_Db_Update {
return;
} else {
// Db update not needed && notice is unactioned -> Thank you note.
\WC_Install::update_db_version();
self::update_done_notice( $note_id );
return;
}

View File

@ -436,8 +436,7 @@ class WC_Install {
* Update WC version to current.
*/
private static function update_wc_version() {
delete_option( 'woocommerce_version' );
add_option( 'woocommerce_version', WC()->version );
update_option( 'woocommerce_version', WC()->version );
}
/**
@ -480,8 +479,7 @@ class WC_Install {
* @param string|null $version New WooCommerce DB version or null.
*/
public static function update_db_version( $version = null ) {
delete_option( 'woocommerce_db_version' );
add_option( 'woocommerce_db_version', is_null( $version ) ? WC()->version : $version );
update_option( 'woocommerce_db_version', is_null( $version ) ? WC()->version : $version );
}
/**