Analytics: Fix update_registered_customer when invalid user_registered value (#37907)

This commit is contained in:
Matt Sherman 2023-04-24 10:12:48 -04:00 committed by GitHub
parent c038f22c6d
commit 2ab11a7236
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Handle updating customer when user_registered is 0000-00-00 00:00:00.

View File

@ -747,7 +747,7 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
'state' => $customer->get_billing_state( 'edit' ),
'postcode' => $customer->get_billing_postcode( 'edit' ),
'country' => $customer->get_billing_country( 'edit' ),
'date_registered' => $customer->get_date_created( 'edit' )->date( TimeInterval::$sql_datetime_format ),
'date_registered' => $customer->get_date_created( 'edit' ) ? $customer->get_date_created( 'edit' )->date( TimeInterval::$sql_datetime_format ) : null,
'date_last_active' => $last_active ? gmdate( 'Y-m-d H:i:s', $last_active ) : null,
);
$format = array(