Skip to content

Commit 855a26b

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents 6a5e280 + a3adb88 commit 855a26b

File tree

80 files changed

+932
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+932
-97
lines changed

app/code/Magento/Backend/Block/Widget/Form/Container.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ class Container extends \Magento\Backend\Block\Widget\Container
3737
* @var string
3838
*/
3939
protected $_blockGroup = 'Magento_Backend';
40+
41+
/**
42+
* @var string
43+
*/
44+
const PARAM_BLOCK_GROUP = 'block_group';
45+
46+
/**
47+
* @var string
48+
*/
49+
const PARAM_MODE = 'mode';
4050

4151
/**
4252
* @var string
@@ -49,6 +59,12 @@ class Container extends \Magento\Backend\Block\Widget\Container
4959
protected function _construct()
5060
{
5161
parent::_construct();
62+
if ($this->hasData(self::PARAM_BLOCK_GROUP)) {
63+
$this->_blockGroup = $this->_getData(self::PARAM_BLOCK_GROUP);
64+
}
65+
if ($this->hasData(self::PARAM_MODE)) {
66+
$this->_mode = $this->_getData(self::PARAM_MODE);
67+
}
5268

5369
$this->addButton(
5470
'back',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ public function export()
817817
while (true) {
818818
++$page;
819819
$entityCollection = $this->_getEntityCollection(true);
820-
$entityCollection->setOrder('has_options', 'asc');
820+
$entityCollection->setOrder('entity_id', 'asc');
821821
$entityCollection->setStoreId(Store::DEFAULT_STORE_ID);
822822
$this->_prepareEntityCollection($entityCollection);
823823
$this->paginateCollection($page, $this->getItemsPerPage());

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,10 @@ class Product extends \Magento\ImportExport\Model\Import\Entity\AbstractEntity
561561
/** @var array */
562562
protected $productUrlSuffix = [];
563563

564-
/** @var array */
564+
/**
565+
* @var array
566+
* @deprecated
567+
*/
565568
protected $productUrlKeys = [];
566569

567570
/**
@@ -1508,6 +1511,10 @@ protected function _saveProducts()
15081511
}
15091512
$rowScope = $this->getRowScope($rowData);
15101513

1514+
if (empty($rowData[self::URL_KEY])) {
1515+
$rowData[self::URL_KEY] = $this->getUrlKey($rowData);
1516+
}
1517+
15111518
$rowSku = $rowData[self::COL_SKU];
15121519

15131520
if (null === $rowSku) {
@@ -2562,12 +2569,14 @@ protected function getProductUrlSuffix($storeId = null)
25622569
protected function getUrlKey($rowData)
25632570
{
25642571
if (!empty($rowData[self::URL_KEY])) {
2565-
$this->productUrlKeys[$rowData[self::COL_SKU]] = $rowData[self::URL_KEY];
2572+
return $rowData[self::URL_KEY];
2573+
}
2574+
2575+
if (!empty($rowData[self::COL_NAME])) {
2576+
return $this->productUrl->formatUrlKey($rowData[self::COL_NAME]);
25662577
}
2567-
$urlKey = !empty($this->productUrlKeys[$rowData[self::COL_SKU]])
2568-
? $this->productUrlKeys[$rowData[self::COL_SKU]]
2569-
: $this->productUrl->formatUrlKey($rowData[self::COL_NAME]);
2570-
return $urlKey;
2578+
2579+
return '';
25712580
}
25722581

25732582
/**

app/code/Magento/CatalogImportExport/Test/Unit/Model/Export/ProductTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ public function testExportCountZeroBreakInternalCalls()
403403
$this->product->expects($this->once())->method('_prepareEntityCollection')->with($this->abstractCollection);
404404
$this->product->expects($this->once())->method('getItemsPerPage')->willReturn($itemsPerPage);
405405
$this->product->expects($this->once())->method('paginateCollection')->with($page, $itemsPerPage);
406-
$this->abstractCollection->expects($this->once())->method('setOrder')->with('has_options', 'asc');
406+
$this->abstractCollection->expects($this->once())->method('setOrder')->with('entity_id', 'asc');
407407
$this->abstractCollection->expects($this->once())->method('setStoreId')->with(Store::DEFAULT_STORE_ID);
408408

409409
$this->abstractCollection->expects($this->once())->method('count')->willReturn(0);
@@ -434,7 +434,7 @@ public function testExportCurPageEqualToLastBreakInternalCalls()
434434
$this->product->expects($this->once())->method('_prepareEntityCollection')->with($this->abstractCollection);
435435
$this->product->expects($this->once())->method('getItemsPerPage')->willReturn($itemsPerPage);
436436
$this->product->expects($this->once())->method('paginateCollection')->with($page, $itemsPerPage);
437-
$this->abstractCollection->expects($this->once())->method('setOrder')->with('has_options', 'asc');
437+
$this->abstractCollection->expects($this->once())->method('setOrder')->with('entity_id', 'asc');
438438
$this->abstractCollection->expects($this->once())->method('setStoreId')->with(Store::DEFAULT_STORE_ID);
439439

440440
$this->abstractCollection->expects($this->once())->method('count')->willReturn(1);
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\CatalogInventory\Setup;
7+
8+
use Magento\CatalogInventory\Api\StockConfigurationInterface;
9+
use Magento\Framework\Indexer\AbstractProcessor;
10+
use Magento\Framework\Setup\UpgradeDataInterface;
11+
use Magento\Framework\Setup\ModuleContextInterface;
12+
use Magento\Framework\Setup\ModuleDataSetupInterface;
13+
use Magento\Store\Model\StoreManagerInterface;
14+
15+
/**
16+
* Upgrade Data script
17+
* @codeCoverageIgnore
18+
*/
19+
class UpgradeData implements UpgradeDataInterface
20+
{
21+
/**
22+
* @var StockConfigurationInterface
23+
*/
24+
private $configuration;
25+
26+
/**
27+
* @var AbstractProcessor
28+
*/
29+
private $indexerProcessor;
30+
31+
/**
32+
* @var StoreManagerInterface
33+
*/
34+
private $storeManager;
35+
36+
/**
37+
* @param StockConfigurationInterface $configuration
38+
* @param StoreManagerInterface $storeManager
39+
* @param AbstractProcessor $indexerProcessor
40+
*/
41+
public function __construct(
42+
StockConfigurationInterface $configuration,
43+
StoreManagerInterface $storeManager,
44+
AbstractProcessor $indexerProcessor
45+
) {
46+
$this->configuration = $configuration;
47+
$this->storeManager = $storeManager;
48+
$this->indexerProcessor = $indexerProcessor;
49+
}
50+
51+
/**
52+
* {@inheritdoc}
53+
*/
54+
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
55+
{
56+
$setup->startSetup();
57+
if (version_compare($context->getVersion(), '2.0.2') < 0) {
58+
$this->upgradeCatalogInventoryStockItem($setup);
59+
}
60+
$setup->endSetup();
61+
}
62+
63+
/**
64+
* @param ModuleDataSetupInterface $setup
65+
* @return void
66+
*/
67+
private function upgradeCatalogInventoryStockItem($setup)
68+
{
69+
$setup->getConnection()->update(
70+
$setup->getTable('cataloginventory_stock_item'),
71+
['website_id' => $this->configuration->getDefaultScopeId()],
72+
['website_id = ?' => $this->storeManager->getWebsite()->getId()]
73+
);
74+
$this->indexerProcessor->getIndexer()->invalidate();
75+
}
76+
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,9 @@
7474
<type name="Magento\Catalog\Api\ProductRepositoryInterface">
7575
<plugin name="catalogInventoryAroundSave" sortOrder="20" type="Magento\CatalogInventory\Model\Plugin\AroundProductRepositorySave"/>
7676
</type>
77+
<type name="Magento\CatalogInventory\Setup\UpgradeData">
78+
<arguments>
79+
<argument name="indexerProcessor" xsi:type="object">Magento\CatalogInventory\Model\Indexer\Stock\Processor</argument>
80+
</arguments>
81+
</type>
7782
</config>

app/code/Magento/CatalogInventory/etc/module.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:Module/etc/module.xsd">
9-
<module name="Magento_CatalogInventory" setup_version="2.0.1">
9+
<module name="Magento_CatalogInventory" setup_version="2.0.2">
1010
<sequence>
1111
<module name="Magento_Catalog"/>
1212
</sequence>

app/code/Magento/Deploy/Console/Command/SetModeCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
104104
throw new LocalizedException(__('Cannot switch into given mode "%1"', $toMode));
105105
}
106106
$output->writeln('Enabled ' . $toMode . ' mode.');
107+
108+
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
107109
} catch (\Exception $e) {
108110
$output->writeln('<error>' . $e->getMessage() . '</error>');
109111
if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {

app/code/Magento/Widget/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/AbstractContainerTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,14 @@ protected function setUp()
103103
->disableOriginalConstructor()
104104
->getMock();
105105

106-
$this->escaperMock = $this->getMock(\Magento\Framework\Escaper::class, ['escapeHtml'], [], '', false);
106+
$this->escaperMock = $this->getMock(
107+
\Magento\Framework\Escaper::class,
108+
['escapeHtml', 'escapeHtmlAttr'],
109+
[],
110+
'',
111+
false
112+
);
113+
$this->escaperMock->expects($this->any())->method('escapeHtmlAttr')->willReturnArgument(0);
107114

108115
$this->contextMock = $this->getMockBuilder(\Magento\Backend\Block\Context::class)
109116
->setMethods(['getEventManager', 'getScopeConfig', 'getEscaper'])

dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/CreateCmsBlockEntityTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class CreateCmsBlockEntityTest extends AbstractCmsBlockEntityTest
2727
/* tags */
2828
const MVP = 'yes';
2929
const TEST_TYPE = 'extended_acceptance_test';
30+
const SEVERITY = 'S1';
3031
/* end tags */
3132

3233
/**

0 commit comments

Comments
 (0)