Parse transient value to integer if retrieved from transient (https://github.com/woocommerce/woocommerce-admin/pull/7161)

* Parse transient value to integer if retrieved from transient

* Add changelog
This commit is contained in:
louwie17 2021-06-14 14:05:01 -03:00 committed by GitHub
parent b9df97c984
commit db845addd4
2 changed files with 7 additions and 0 deletions

View File

@ -168,6 +168,7 @@ Release and roadmap notes are available on the [WooCommerce Developers Blog](htt
- Fix: Add target to the button to open it in a new tab #7110
- Fix: Make `Search` accept synchronous `autocompleter.options`. #6884
- Fix: Set autoload to false for all remote inbox notifications options. #7060
- Fix: Issue where summary stats were not showing in Analytics > Stock. #7161
- Tweak: Only fetch remote payment gateway recommendations when opted in #6964
- Tweak: Setup checklist copy revert. #7015
- Update: Task list component with new Experimental Task list. #6849

View File

@ -29,6 +29,8 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
if ( false === $low_stock_count ) {
$low_stock_count = $this->get_low_stock_count();
set_transient( $low_stock_transient_name, $low_stock_count, $cache_expire );
} else {
$low_stock_count = intval( $low_stock_count );
}
$report_data['lowstock'] = $low_stock_count;
@ -39,6 +41,8 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
if ( false === $count ) {
$count = $this->get_count( $status );
set_transient( $transient_name, $count, $cache_expire );
} else {
$count = intval( $count );
}
$report_data[ $status ] = $count;
}
@ -48,6 +52,8 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
if ( false === $product_count ) {
$product_count = $this->get_product_count();
set_transient( $product_count_transient_name, $product_count, $cache_expire );
} else {
$product_count = intval( $product_count );
}
$report_data['products'] = $product_count;
return $report_data;