Skip to content

Commit 41448ec

Browse files
author
Volodymyr Klymenko
authored
Merge pull request #847 from magento-tsg/2.0-develop-pr6
[TSG] Backporting for 2.0 (pr6)
2 parents e3948c1 + 4b42941 commit 41448ec

File tree

81 files changed

+1516
-328
lines changed

Some content is hidden

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

81 files changed

+1516
-328
lines changed

app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
class Full extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractAction
99
{
10+
/**
11+
* Whether to use main or temporary index table
12+
*
13+
* @var bool
14+
*/
15+
protected $useTempTable = false;
16+
1017
/**
1118
* Refresh entities index
1219
*

app/code/Magento/Catalog/Model/ResourceModel/MaxHeapTableSizeProcessor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
use Magento\Framework\App\ResourceConnection;
99

10+
/**
11+
* @deprecated
12+
*/
1013
class MaxHeapTableSizeProcessor
1114
{
1215
/**

app/code/Magento/Catalog/Plugin/Model/Indexer/Category/Product/MaxHeapTableSizeProcessorOnFullReindex.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
use Magento\Catalog\Model\ResourceModel\MaxHeapTableSizeProcessor;
1111
use Psr\Log\LoggerInterface;
1212

13+
/**
14+
* @deprecated
15+
*/
1316
class MaxHeapTableSizeProcessorOnFullReindex
1417
{
1518
/**

app/code/Magento/Catalog/etc/adminhtml/di.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
</type>
6363
<type name="Magento\Catalog\Model\Indexer\Category\Product\Action\Full">
6464
<plugin name="invalidate_pagecache_after_full_reindex" type="Magento\Catalog\Plugin\Model\Indexer\Category\Product\Execute" />
65-
<plugin name="max_heap_tablse_size_processor_on_full_reindex" type="Magento\Catalog\Plugin\Model\Indexer\Category\Product\MaxHeapTableSizeProcessorOnFullReindex"/>
6665
</type>
6766
<type name="Magento\Catalog\Model\ResourceModel\Attribute">
6867
<plugin name="invalidate_pagecache_after_attribute_save" type="Magento\Catalog\Plugin\Model\ResourceModel\Attribute\Save" />

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<div data-role="tabs" id="product-edit-form-tabs"></div> <?php /* @TODO: remove id after elimination of setDestElementId('product-edit-form-tabs') */?>
5454
<?php echo $block->getChildHtml('product-type-tabs') ?>
5555
<input type="hidden" id="product_type_id" value="<?php /* @escapeNotVerified */ echo $block->getProduct()->getTypeId()?>"/>
56-
<input type="hidden" id="attribute_set_id" value="<?php /* @escapeNotVerified */ echo $block->getProduct()->getAttributeSetId()?>"/>
56+
<input type="hidden" id="attribute_set_id" name="set" value="<?php /* @escapeNotVerified */ echo $block->getProduct()->getAttributeSetId()?>"/>
5757
<button type="submit" class="hidden"></button>
5858
<?php if ($block->getUseContainer()): ?>
5959
</form>

app/code/Magento/Catalog/view/adminhtml/web/js/options.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ define([
5858

5959
if (render) {
6060
this.render();
61+
this.updateItemsCountField();
6162
}
6263
},
6364
remove: function (event) {

app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ protected function _renderFiltersBefore()
207207
[]
208208
);
209209

210-
$this->_totalRecords = $this->queryResponse->count();
211-
212210
if ($this->order && 'relevance' === $this->order['field']) {
213211
$this->getSelect()->order('search_result.'. TemporaryStorage::FIELD_SCORE . ' ' . $this->order['dir']);
214212
}

app/code/Magento/CatalogWidget/Block/Product/Widget/Conditions.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,16 @@ public function __construct(
8282
protected function _construct()
8383
{
8484
$widget = $this->registry->registry('current_widget_instance');
85+
$widgetOptions = $this->getLayout()->getBlock('wysiwyg_widget.options');
86+
8587
if ($widget) {
8688
$widgetParameters = $widget->getWidgetParameters();
87-
if (isset($widgetParameters['conditions'])) {
88-
$this->rule->loadPost($widgetParameters);
89-
}
89+
} elseif ($widgetOptions) {
90+
$widgetParameters = $widgetOptions->getWidgetValues();
91+
}
92+
93+
if (isset($widgetParameters['conditions'])) {
94+
$this->rule->loadPost($widgetParameters);
9095
}
9196
}
9297

app/code/Magento/CatalogWidget/Test/Unit/Controller/Adminhtml/Product/Widget/ConditionsTest.php

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

99
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
1010

11+
/**
12+
* Test class for \Magento\CatalogWidget\Controller\Adminhtml\Product\Widget\Conditions
13+
*/
1114
class ConditionsTest extends \PHPUnit_Framework_TestCase
1215
{
1316
/**
@@ -37,16 +40,16 @@ class ConditionsTest extends \PHPUnit_Framework_TestCase
3740

3841
protected function setUp()
3942
{
40-
$this->rule = $this->getMock('Magento\CatalogWidget\Model\Rule', [], [], '', false);
41-
$this->response = $this->getMockBuilder('\Magento\Framework\App\ResponseInterface')
43+
$this->rule = $this->getMock(\Magento\CatalogWidget\Model\Rule::class, [], [], '', false);
44+
$this->response = $this->getMockBuilder(\Magento\Framework\App\ResponseInterface::class)
4245
->setMethods(['setBody', 'sendResponse'])
4346
->disableOriginalConstructor()
4447
->getMock();
4548
$this->response->expects($this->once())->method('setBody')->will($this->returnSelf());
4649

4750
$objectManagerHelper = new ObjectManagerHelper($this);
4851
$arguments = $objectManagerHelper->getConstructArguments(
49-
'Magento\CatalogWidget\Controller\Adminhtml\Product\Widget\Conditions',
52+
\Magento\CatalogWidget\Controller\Adminhtml\Product\Widget\Conditions::class,
5053
[
5154
'rule' => $this->rule,
5255
'response' => $this->response
@@ -56,7 +59,7 @@ protected function setUp()
5659

5760
$this->objectManager = $arguments['context']->getObjectManager();
5861
$this->controller = $objectManagerHelper->getObject(
59-
'Magento\CatalogWidget\Controller\Adminhtml\Product\Widget\Conditions',
62+
\Magento\CatalogWidget\Controller\Adminhtml\Product\Widget\Conditions::class,
6063
$arguments
6164
);
6265
}
@@ -69,7 +72,7 @@ public function testExecute()
6972
$this->request->expects($this->at(2))->method('getParam')->with('form')
7073
->will($this->returnValue('request_form_param_value'));
7174

72-
$condition = $this->getMockBuilder('Magento\CatalogWidget\Model\Rule\Condition\Product')
75+
$condition = $this->getMockBuilder(\Magento\CatalogWidget\Model\Rule\Condition\Product::class)
7376
->setMethods([
7477
'setId',
7578
'setType',
@@ -82,7 +85,7 @@ public function testExecute()
8285
->getMock();
8386
$condition->expects($this->once())->method('setId')->with('1--1')->will($this->returnSelf());
8487
$condition->expects($this->once())->method('setType')
85-
->with('Magento\CatalogWidget\Model\Rule\Condition\Product')
88+
->with(\Magento\CatalogWidget\Model\Rule\Condition\Product::class)
8689
->will($this->returnSelf());
8790
$condition->expects($this->once())->method('setRule')->with($this->rule)->will($this->returnSelf());
8891
$condition->expects($this->once())->method('setPrefix')->with('conditions')->will($this->returnSelf());

app/code/Magento/Checkout/Block/Cart/Sidebar.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public function getConfig()
6464
'removeItemUrl' => $this->getRemoveItemUrl(),
6565
'imageTemplate' => $this->getImageHtmlTemplate(),
6666
'baseUrl' => $this->getBaseUrl(),
67-
'minicartMaxItemsVisible' => $this->getMiniCartMaxItemsCount()
67+
'minicartMaxItemsVisible' => $this->getMiniCartMaxItemsCount(),
68+
'websiteId' => $this->_storeManager->getStore()->getWebsiteId()
6869
];
6970
}
7071

0 commit comments

Comments
 (0)