Skip to content

Commit 547c401

Browse files
committed
Merge remote-tracking branch 'mainline/2.1' into MAGETWO-54682-2.1
2 parents 3c51b12 + 32b7a8f commit 547c401

File tree

10 files changed

+37
-39
lines changed

10 files changed

+37
-39
lines changed

app/code/Magento/Catalog/Setup/CategorySetup.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function getDefaultEntities()
6666
{
6767
return [
6868
'catalog_category' => [
69+
'entity_type_id' => 3,
6970
'entity_model' => 'Magento\Catalog\Model\ResourceModel\Category',
7071
'attribute_model' => 'Magento\Catalog\Model\ResourceModel\Eav\Attribute',
7172
'table' => 'catalog_category_entity',
@@ -334,6 +335,7 @@ public function getDefaultEntities()
334335
],
335336
],
336337
'catalog_product' => [
338+
'entity_type_id' => 4,
337339
'entity_model' => 'Magento\Catalog\Model\ResourceModel\Product',
338340
'attribute_model' => 'Magento\Catalog\Model\ResourceModel\Eav\Attribute',
339341
'table' => 'catalog_product_entity',

app/code/Magento/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ define([
246246
target = $(this.options.minicart.list),
247247
outerHeight;
248248

249+
self.scrollHeight = 0;
249250
target.children().each(function () {
250251

251252
if ($(this).find('.options').length > 0) {
@@ -259,7 +260,7 @@ define([
259260
self.scrollHeight += outerHeight;
260261
});
261262

262-
target.height(height);
263+
target.parent().height(height);
263264
}
264265
});
265266

app/code/Magento/Customer/Setup/CustomerSetup.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ public function getDefaultEntities()
126126
{
127127
$entities = [
128128
'customer' => [
129+
'entity_type_id' => \Magento\Customer\Api\CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER,
129130
'entity_model' => 'Magento\Customer\Model\ResourceModel\Customer',
130131
'attribute_model' => 'Magento\Customer\Model\Attribute',
131132
'table' => 'customer_entity',
@@ -338,6 +339,7 @@ public function getDefaultEntities()
338339
],
339340
],
340341
'customer_address' => [
342+
'entity_type_id' => \Magento\Customer\Api\AddressMetadataInterface::ATTRIBUTE_SET_ID_ADDRESS,
341343
'entity_model' => 'Magento\Customer\Model\ResourceModel\Address',
342344
'attribute_model' => 'Magento\Customer\Model\Attribute',
343345
'table' => 'customer_address_entity',

app/code/Magento/Eav/Setup/EavSetup.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,21 @@ public function addEntityType($code, array $params)
192192
'additional_attribute_table' => $this->_getValue($params, 'additional_attribute_table'),
193193
'entity_attribute_collection' => $this->_getValue($params, 'entity_attribute_collection'),
194194
];
195+
if (isset($params['entity_type_id'])) {
196+
$data['entity_type_id'] = $params['entity_type_id'];
197+
}
195198

196199
if ($this->getEntityType($code, 'entity_type_id')) {
197200
$this->updateEntityType($code, $data);
198201
} else {
199202
$this->setup->getConnection()->insert($this->setup->getTable('eav_entity_type'), $data);
200203
}
201204

202-
$this->addAttributeSet($code, $this->_defaultAttributeSetName);
205+
if (isset($params['entity_type_id'])) {
206+
$this->addAttributeSet($code, $this->_defaultAttributeSetName, null, $params['entity_type_id']);
207+
} else {
208+
$this->addAttributeSet($code, $this->_defaultAttributeSetName);
209+
}
203210
$this->addAttributeGroup($code, $this->_defaultGroupName, $this->_generalGroupName);
204211

205212
return $this;
@@ -310,16 +317,21 @@ public function getAttributeSetSortOrder($entityTypeId, $sortOrder = null)
310317
* @param int|string $entityTypeId
311318
* @param string $name
312319
* @param int $sortOrder
320+
* @param int $setId
313321
* @return $this
314322
*/
315-
public function addAttributeSet($entityTypeId, $name, $sortOrder = null)
323+
public function addAttributeSet($entityTypeId, $name, $sortOrder = null, $setId = null)
316324
{
317325
$data = [
318326
'entity_type_id' => $this->getEntityTypeId($entityTypeId),
319327
'attribute_set_name' => $name,
320328
'sort_order' => $this->getAttributeSetSortOrder($entityTypeId, $sortOrder),
321329
];
322330

331+
if ($setId !== null) {
332+
$data['attribute_set_id'] = $setId;
333+
}
334+
323335
$setId = $this->getAttributeSet($entityTypeId, $name, 'attribute_set_id');
324336
if ($setId) {
325337
$this->updateAttributeSet($entityTypeId, $setId, $data);

app/code/Magento/Sales/Setup/SalesSetup.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,27 +214,31 @@ public function getDefaultEntities()
214214
{
215215
$entities = [
216216
'order' => [
217+
'entity_type_id' => 5,
217218
'entity_model' => 'Magento\Sales\Model\ResourceModel\Order',
218219
'table' => 'sales_order',
219220
'increment_model' => 'Magento\Eav\Model\Entity\Increment\NumericValue',
220221
'increment_per_store' => true,
221222
'attributes' => [],
222223
],
223224
'invoice' => [
225+
'entity_type_id' => 6,
224226
'entity_model' => 'Magento\Sales\Model\ResourceModel\Order\Invoice',
225227
'table' => 'sales_invoice',
226228
'increment_model' => 'Magento\Eav\Model\Entity\Increment\NumericValue',
227229
'increment_per_store' => true,
228230
'attributes' => [],
229231
],
230232
'creditmemo' => [
233+
'entity_type_id' => 7,
231234
'entity_model' => 'Magento\Sales\Model\ResourceModel\Order\Creditmemo',
232235
'table' => 'sales_creditmemo',
233236
'increment_model' => 'Magento\Eav\Model\Entity\Increment\NumericValue',
234237
'increment_per_store' => true,
235238
'attributes' => [],
236239
],
237240
'shipment' => [
241+
'entity_type_id' => 8,
238242
'entity_model' => 'Magento\Sales\Model\ResourceModel\Order\Shipment',
239243
'table' => 'sales_shipment',
240244
'increment_model' => 'Magento\Eav\Model\Entity\Increment\NumericValue',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
<item name="frontName" xsi:type="null" />
224224
<item name="router" xsi:type="string">standard</item>
225225
</item>
226+
<item name="setup" xsi:type="null"/>
226227
</argument>
227228
<argument name="default" xsi:type="string">frontend</argument>
228229
</arguments>

dev/tests/functional/tests/app/Magento/Catalog/Test/TestStep/CreateProductsStep.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct(FixtureFactory $fixtureFactory, $products, array $da
6060
public function run()
6161
{
6262
$products = [];
63-
$productsDataSets = explode(',', $this->products);
63+
$productsDataSets = is_array($this->products) ? $this->products : explode(',', $this->products);
6464
foreach ($productsDataSets as $key => $productDataSet) {
6565
$productDataSet = explode('::', $productDataSet);
6666
$fixtureClass = $productDataSet[0];

lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
use Magento\Framework\ObjectManager\ConfigLoaderInterface;
1010

11+
/**
12+
* Class Compiled returns configuration cache information
13+
*/
1114
class Compiled implements ConfigLoaderInterface
1215
{
1316
/**
@@ -25,8 +28,12 @@ public function load($area)
2528
if (isset($this->configCache[$area])) {
2629
return $this->configCache[$area];
2730
}
28-
$this->configCache[$area] = \unserialize(\file_get_contents(self::getFilePath($area)));
29-
return $this->configCache[$area];
31+
$filePath = self::getFilePath($area);
32+
if (\file_exists($filePath)) {
33+
$this->configCache[$area] = \unserialize(\file_get_contents($filePath));
34+
return $this->configCache[$area];
35+
}
36+
return [];
3037
}
3138

3239
/**

setup/src/Magento/Setup/Console/Command/UpgradeCommand.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ class UpgradeCommand extends AbstractSetupCommand
2929
*/
3030
private $installerFactory;
3131

32-
/**
33-
* @var \Magento\Setup\Model\ObjectManagerProvider;
34-
*/
35-
private $objectManagerProvider;
36-
3732
/**
3833
* Constructor
3934
*
@@ -43,7 +38,6 @@ class UpgradeCommand extends AbstractSetupCommand
4338
public function __construct(InstallerFactory $installerFactory, ObjectManagerProvider $objectManagerProvider)
4439
{
4540
$this->installerFactory = $installerFactory;
46-
$this->objectManagerProvider = $objectManagerProvider;
4741
parent::__construct();
4842
}
4943

@@ -73,16 +67,6 @@ protected function configure()
7367
*/
7468
protected function execute(InputInterface $input, OutputInterface $output)
7569
{
76-
$areaCode = 'setup';
77-
/** @var \Magento\Framework\ObjectManagerInterface $objectManager */
78-
$objectManager = $this->objectManagerProvider->get();
79-
/** @var \Magento\Framework\App\State $appState */
80-
$appState = $objectManager->get('Magento\Framework\App\State');
81-
$appState->setAreaCode($areaCode);
82-
/** @var \Magento\Framework\ObjectManager\ConfigLoaderInterface $configLoader */
83-
$configLoader = $objectManager->get('Magento\Framework\ObjectManager\ConfigLoaderInterface');
84-
$objectManager->configure($configLoader->load($areaCode));
85-
8670
$keepGenerated = $input->getOption(self::INPUT_KEY_KEEP_GENERATED);
8771
$installer = $this->installerFactory->create(new ConsoleLogger($output));
8872
$installer->updateModulesSequence($keepGenerated);

setup/src/Magento/Setup/Test/Unit/Console/Command/UpgradeCommandTest.php

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

88
use Magento\Setup\Console\Command\UpgradeCommand;
99
use Symfony\Component\Console\Tester\CommandTester;
10+
use Magento\Framework\Console\Cli;
1011

1112
class UpgradeCommandTest extends \PHPUnit_Framework_TestCase
1213
{
1314
public function testExecute()
1415
{
1516
$installerFactory = $this->getMock('Magento\Setup\Model\InstallerFactory', [], [], '', false);
1617
$objectManagerProvider = $this->getMock('\Magento\Setup\Model\ObjectManagerProvider', [], [], '', false);
17-
$objectManager = $this->getMockForAbstractClass('Magento\Framework\ObjectManagerInterface');
18-
$configLoader = $this->getMockForAbstractClass('Magento\Framework\ObjectManager\ConfigLoaderInterface');
19-
$configLoader->expects($this->once())->method('load')->willReturn(['some_key' => 'some_value']);
20-
$state = $this->getMock('Magento\Framework\App\State', [], [], '', false);
21-
$state->expects($this->once())->method('setAreaCode')->with('setup');
22-
$objectManagerProvider->expects($this->once())->method('get')->willReturn($objectManager);
23-
$objectManager->expects($this->once())->method('configure');
24-
$state->expects($this->once())->method('setAreaCode')->with('setup');
2518
$installer = $this->getMock('Magento\Setup\Model\Installer', [], [], '', false);
2619
$installer->expects($this->at(0))->method('updateModulesSequence');
2720
$installer->expects($this->at(1))->method('installSchema');
2821
$installer->expects($this->at(2))->method('installDataFixtures');
2922
$installerFactory->expects($this->once())->method('create')->willReturn($installer);
30-
31-
$objectManager->expects($this->exactly(2))
32-
->method('get')
33-
->will($this->returnValueMap([
34-
['Magento\Framework\App\State', $state],
35-
['Magento\Framework\ObjectManager\ConfigLoaderInterface', $configLoader]
36-
]));
37-
3823
$commandTester = new CommandTester(new UpgradeCommand($installerFactory, $objectManagerProvider));
39-
$commandTester->execute([]);
24+
$this->assertSame(Cli::RETURN_SUCCESS, $commandTester->execute([]));
4025
}
4126
}

0 commit comments

Comments
 (0)