Skip to content

Commit 833766c

Browse files
author
Korshenko, Olexii(okorshenko)
committed
Merge pull request #725 from magento-nord/develop
[NORD] Sample Data Bug Fixes
2 parents 82cd733 + 43395b7 commit 833766c

File tree

4 files changed

+22
-46
lines changed

4 files changed

+22
-46
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ protected function _saveMediaGallery(array $mediaGalleryData)
18031803
'value' => $insertValue['value'],
18041804
];
18051805
$valueToProductId[$insertValue['value']] = $productId;
1806-
$imageNames = $insertValue['value'];
1806+
$imageNames[] = $insertValue['value'];
18071807
$multiInsertData[] = $valueArr;
18081808
$insertedGalleryImgs[] = $insertValue['value'];
18091809
}

app/code/Magento/SampleData/Model/BlackHole.php

Lines changed: 0 additions & 22 deletions
This file was deleted.

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,4 @@
1515
</argument>
1616
</arguments>
1717
</type>
18-
<virtualType name="Magento\SampleData\Model\BlackHoleFactory" type="\Magento\Framework\Mail\TransportInterfaceFactory">
19-
<arguments>
20-
<argument name="instanceName" xsi:type="string">Magento\SampleData\Model\BlackHole</argument>
21-
</arguments>
22-
</virtualType>
23-
<virtualType name="blackHoleTransportBuilder" type="Magento\Framework\Mail\Template\TransportBuilder">
24-
<arguments>
25-
<argument name="mailTransportFactory" xsi:type="object" >Magento\SampleData\Model\BlackHoleFactory</argument>
26-
</arguments>
27-
</virtualType>
28-
<virtualType name="sampleDataAccountManagement" type="Magento\Customer\Model\AccountManagement">
29-
<arguments>
30-
<argument name="transportBuilder" xsi:type="object">blackHoleTransportBuilder</argument>
31-
</arguments>
32-
</virtualType>
33-
<type name="Magento\SampleData\Module\Customer\Setup\Customer">
34-
<arguments>
35-
<argument name="accountManagement" xsi:type="object">sampleDataAccountManagement</argument>
36-
</arguments>
37-
</type>
3818
</config>

lib/internal/Magento/Framework/Setup/SampleData/Executor.php

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,34 @@
77

88
class Executor
99
{
10+
/**
11+
* @var State
12+
*/
13+
private $state;
14+
15+
/**
16+
* @var \Psr\Log\LoggerInterface
17+
*/
18+
private $logger;
19+
20+
/**
21+
* @var \Magento\Framework\App\State
22+
*/
23+
private $appState;
24+
1025
/**
1126
* @param \Psr\Log\LoggerInterface $logger
12-
* @param \Magento\Framework\Setup\SampleData\State $state
27+
* @param State $state
28+
* @param \Magento\Framework\App\State $appState
1329
*/
1430
public function __construct(
1531
\Psr\Log\LoggerInterface $logger,
16-
\Magento\Framework\Setup\SampleData\State $state
32+
\Magento\Framework\Setup\SampleData\State $state,
33+
\Magento\Framework\App\State $appState
1734
) {
1835
$this->logger = $logger;
1936
$this->state = $state;
37+
$this->appState = $appState;
2038
}
2139

2240
/**
@@ -29,7 +47,7 @@ public function __construct(
2947
public function exec(InstallerInterface $installer)
3048
{
3149
try {
32-
$installer->install();
50+
$this->appState->emulateAreaCode('setup', [$installer, 'install']);
3351
$this->state->setInstalled();
3452
} catch (\Exception $e) {
3553
$this->state->setError();

0 commit comments

Comments
 (0)