Skip to content

Commit 7965b96

Browse files
ENGCOM-6427: Resolve Refresh Statistics: Updated At = Null should be display as "Never" instead of "undefined". issue25931 #25932
2 parents 4089f1e + 6869747 commit 7965b96

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

app/code/Magento/Reports/Controller/Adminhtml/Report/AbstractReport.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
/**
1919
* Reports api controller
2020
*
21+
* phpcs:disable Magento2.Classes.AbstractApi
2122
* @api
2223
* @since 100.0.2
2324
* @SuppressWarnings(PHPMD.AllPurposeAction)
@@ -140,7 +141,7 @@ protected function _showLastExecutionTime($flagCode, $refreshCode)
140141
$flag = $this->_objectManager->create(\Magento\Reports\Model\Flag::class)
141142
->setReportFlagCode($flagCode)
142143
->loadSelf();
143-
$updatedAt = 'undefined';
144+
$updatedAt = __('Never');
144145
if ($flag->hasData()) {
145146
$updatedAt = $this->timezone->formatDate(
146147
$flag->getLastUpdate(),

app/code/Magento/Reports/i18n/en_US.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,5 @@ Action,Action
224224
Report,Report
225225
Description,Description
226226
undefined,undefined
227+
Never,Never
228+

app/code/Magento/Reports/view/adminhtml/layout/reports_report_statistics_index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<argument name="sortable" xsi:type="string">0</argument>
7272
<argument name="id" xsi:type="string">updated_at</argument>
7373
<argument name="index" xsi:type="string">updated_at</argument>
74-
<argument name="default" xsi:type="string" translate="true">undefined</argument>
74+
<argument name="default" xsi:type="string" translate="true">Never</argument>
7575
<argument name="column_css_class" xsi:type="string">col-period</argument>
7676
<argument name="header_css_class" xsi:type="string">col-period</argument>
7777
</arguments>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Reports\Controller\Adminhtml\Report\Statistics;
10+
11+
/**
12+
* @magentoAppArea adminhtml
13+
*/
14+
class IndexTest extends \Magento\TestFramework\TestCase\AbstractBackendController
15+
{
16+
/**
17+
* Test load page
18+
*/
19+
public function testExecute()
20+
{
21+
$this->dispatch('backend/reports/report_statistics');
22+
$actual = $this->getResponse()->getBody();
23+
$this->assertContains('Never', $actual);
24+
}
25+
}

0 commit comments

Comments
 (0)