Skip to content

Commit a57f0cf

Browse files
committed
ACP2E-649: Invalid data is exported when we apply created at filter for customer export
1 parent 9316052 commit a57f0cf

File tree

7 files changed

+43
-29
lines changed

7 files changed

+43
-29
lines changed

app/code/Magento/ImportExport/Api/Data/ExtendedExportInfoInterface.php

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,15 @@ interface ExtendedExportInfoInterface extends ExportInfoInterface
1717
/**
1818
* Returns skipped attributes
1919
*
20-
* @return string[]|null
20+
* @return mixed
2121
*/
22-
public function getSkipAttr(): ?array;
22+
public function getSkipAttr();
2323

2424
/**
2525
* Set skipped attributes
2626
*
27-
* @param string[] $skipAttr
28-
* @return void
27+
* @param string $skipAttr
28+
* @return mixed
2929
*/
30-
public function setSkipAttr(array $skipAttr): void;
31-
32-
/**
33-
* Returns admin locale
34-
*
35-
* @return string|null
36-
*/
37-
public function getLocale(): ?string;
38-
39-
/**
40-
* Set admin locale
41-
*
42-
* @param string $locale
43-
* @return void
44-
*/
45-
public function setLocale(string $locale): void;
30+
public function setSkipAttr($skipAttr);
4631
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\ImportExport\Api\Data;
9+
10+
/**
11+
* Localized export interface for correct parsing values (like date) provided in admin ui locale.
12+
*/
13+
interface LocalizedExportInfoInterface extends ExtendedExportInfoInterface
14+
{
15+
/**
16+
* Returns admin locale
17+
*
18+
* @return string|null
19+
*/
20+
public function getLocale(): ?string;
21+
22+
/**
23+
* Set admin locale
24+
*
25+
* @param string $locale
26+
* @return void
27+
*/
28+
public function setLocale(string $locale): void;
29+
}

app/code/Magento/ImportExport/Model/Export/Consumer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Magento\Framework\Exception\LocalizedException;
1313
use Magento\Framework\Filesystem;
1414
use Magento\Framework\Locale\ResolverInterface;
15-
use Magento\ImportExport\Api\Data\ExtendedExportInfoInterface;
15+
use Magento\ImportExport\Api\Data\LocalizedExportInfoInterface;
1616
use Magento\ImportExport\Api\ExportManagementInterface;
1717
use Magento\Framework\Notification\NotifierInterface;
1818

@@ -71,10 +71,10 @@ public function __construct(
7171
/**
7272
* Consumer logic.
7373
*
74-
* @param ExtendedExportInfoInterface $exportInfo
74+
* @param LocalizedExportInfoInterface $exportInfo
7575
* @return void
7676
*/
77-
public function process(ExtendedExportInfoInterface $exportInfo)
77+
public function process(LocalizedExportInfoInterface $exportInfo)
7878
{
7979
$currentLocale = $this->localeResolver->getLocale();
8080
if ($exportInfo->getLocale()) {

app/code/Magento/ImportExport/Model/Export/Entity/ExportInfo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
namespace Magento\ImportExport\Model\Export\Entity;
99

10-
use Magento\ImportExport\Api\Data\ExtendedExportInfoInterface;
10+
use Magento\ImportExport\Api\Data\LocalizedExportInfoInterface;
1111

1212
/**
1313
* Class ExportInfo implementation for ExportInfoInterface.
1414
*/
15-
class ExportInfo implements ExtendedExportInfoInterface
15+
class ExportInfo implements LocalizedExportInfoInterface
1616
{
1717
/**
1818
* @var string

app/code/Magento/ImportExport/Test/Unit/Model/Export/ConsumerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Magento\Framework\Filesystem\Directory\WriteInterface;
1313
use Magento\Framework\Locale\ResolverInterface;
1414
use Magento\Framework\Notification\NotifierInterface;
15-
use Magento\ImportExport\Api\Data\ExtendedExportInfoInterface;
15+
use Magento\ImportExport\Api\Data\LocalizedExportInfoInterface;
1616
use Magento\ImportExport\Api\ExportManagementInterface;
1717
use Magento\ImportExport\Model\Export\Consumer;
1818
use PHPUnit\Framework\MockObject\MockObject;
@@ -70,7 +70,7 @@ protected function setUp(): void
7070
public function testProcess()
7171
{
7272
$adminLocale = 'de_DE';
73-
$exportInfoMock = $this->createMock(ExtendedExportInfoInterface::class);
73+
$exportInfoMock = $this->createMock(LocalizedExportInfoInterface::class);
7474
$exportInfoMock->expects($this->atLeastOnce())
7575
->method('getLocale')
7676
->willReturn($adminLocale);

app/code/Magento/ImportExport/etc/communication.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Communication/etc/communication.xsd">
9-
<topic name="import_export.export" request="Magento\ImportExport\Api\Data\ExtendedExportInfoInterface">
9+
<topic name="import_export.export" request="Magento\ImportExport\Api\Data\LocalizedExportInfoInterface">
1010
<handler name="exportProcessor" type="Magento\ImportExport\Model\Export\Consumer" method="process" />
1111
</topic>
1212
</config>

app/code/Magento/ImportExport/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<preference for="Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface" type="Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregator" />
1212
<preference for="Magento\ImportExport\Model\Report\ReportProcessorInterface" type="Magento\ImportExport\Model\Report\Csv" />
1313
<preference for="Magento\ImportExport\Api\Data\ExportInfoInterface" type="Magento\ImportExport\Model\Export\Entity\ExportInfo" />
14-
<preference for="Magento\ImportExport\Api\Data\ExtendedExportInfoInterface" type="Magento\ImportExport\Model\Export\Entity\ExportInfo" />
14+
<preference for="Magento\ImportExport\Api\Data\LocalizedExportInfoInterface" type="Magento\ImportExport\Model\Export\Entity\ExportInfo" />
1515
<preference for="Magento\ImportExport\Api\ExportManagementInterface" type="Magento\ImportExport\Model\Export\ExportManagement" />
1616
<type name="Magento\Framework\Module\Setup\Migration">
1717
<arguments>

0 commit comments

Comments
 (0)