Avoid caching extended info on Analytics -> Products (https://github.com/woocommerce/woocommerce-admin/pull/7819)

* Do not cache extended info -- this is required to get the latest stock data

* Add changelog
This commit is contained in:
Moon 2021-11-02 15:18:57 -07:00 committed by GitHub
parent 5356726638
commit 6205c8ba01
2 changed files with 6 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: Tweak
Avoid caching extended info #7819

View File

@ -360,8 +360,6 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
return $data;
}
$this->include_extended_info( $product_data, $query_args );
$product_data = array_map( array( $this, 'cast_numbers' ), $product_data );
$data = (object) array(
'data' => $product_data,
@ -373,6 +371,8 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
$this->set_cached_data( $cache_key, $data );
}
$this->include_extended_info( $data->data, $query_args );
return $data;
}