Merge pull request #27696 from woocommerce/fix/version-race-conditions
Fix some race conditions in WC_Install
This commit is contained in:
commit
e34681dbb4
|
@ -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';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue