Skip to content

Commit c210777

Browse files
author
Yaroslav Onischenko
committed
Merge remote-tracking branch 'mainline/develop' into develop
2 parents 46ebd43 + 91c7893 commit c210777

File tree

13 files changed

+34
-43
lines changed

13 files changed

+34
-43
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ protected function _prepareCollection()
104104
'sku'
105105
)->addAttributeToSelect(
106106
'price'
107-
)->addStoreFilter(
108-
$this->getRequest()->getParam('store')
109107
)->joinField(
110108
'position',
111109
'catalog_category_product',
@@ -114,6 +112,10 @@ protected function _prepareCollection()
114112
'category_id=' . (int)$this->getRequest()->getParam('id', 0),
115113
'left'
116114
);
115+
$storeId = (int)$this->getRequest()->getParam('store', 0);
116+
if ($storeId > 0) {
117+
$collection->addStoreFilter($storeId);
118+
}
117119
$this->setCollection($collection);
118120

119121
if ($this->getCategory()->getProductsReadonly()) {

app/code/Magento/Catalog/Controller/Adminhtml/Category/Move.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ public function execute()
6767
throw new \Exception(__('Category is not available for requested store.'));
6868
}
6969
$category->move($parentNodeId, $prevNodeId);
70-
} catch (\Magento\Framework\Exception\LocalizedException $e) {
71-
$error = true;
72-
$this->messageManager->addError(__('There was a category move error.'));
7370
} catch (\Magento\Framework\Exception\AlreadyExistsException $e) {
7471
$error = true;
7572
$this->messageManager->addError(__('There was a category move error. %1', $e->getMessage()));
73+
} catch (\Magento\Framework\Exception\LocalizedException $e) {
74+
$error = true;
75+
$this->messageManager->addError($e->getMessage());
7676
} catch (\Exception $e) {
7777
$error = true;
7878
$this->messageManager->addError(__('There was a category move error.'));

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -522,17 +522,14 @@ public function duplicate($oldId, $newId)
522522
)->where(
523523
$this->getLinkField() . ' = ?',
524524
$oldId
525-
)->where(
526-
'store_id >= ?',
527-
0
528525
);
529526

530527
$connection->query(
531528
$connection->insertFromSelect(
532529
$select,
533530
$tableName,
534531
['attribute_id', 'store_id', $this->getLinkField(), 'value'],
535-
\Magento\Framework\DB\Adapter\AdapterInterface::INSERT_ON_DUPLICATE
532+
\Magento\Framework\DB\Adapter\AdapterInterface::INSERT_IGNORE
536533
)
537534
);
538535
}
@@ -541,7 +538,6 @@ public function duplicate($oldId, $newId)
541538
$statusAttribute = $this->getAttribute('status');
542539
$statusAttributeId = $statusAttribute->getAttributeId();
543540
$statusAttributeTable = $statusAttribute->getBackend()->getTable();
544-
$updateCond[] = 'store_id >= 0';
545541
$updateCond[] = $connection->quoteInto($this->getLinkField() . ' = ?', $newId);
546542
$updateCond[] = $connection->quoteInto('attribute_id = ?', $statusAttributeId);
547543
$connection->update(

app/code/Magento/Catalog/Test/Unit/Model/Product/Gallery/GalleryManagementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function testCreateWithCannotSaveException()
9797
$productSku = 'mediaProduct';
9898
$entryContentMock = $this->getMockBuilder('\Magento\Framework\Api\Data\ImageContentInterface')
9999
->disableOriginalConstructor()
100-
->getMock();;
100+
->getMock();
101101
$this->mediaGalleryEntryMock->expects($this->any())->method('getContent')->willReturn($entryContentMock);
102102
$this->productRepositoryMock->expects($this->once())
103103
->method('get')

app/code/Magento/Catalog/view/adminhtml/templates/catalog/category/tree.phtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,9 @@
493493
} else {
494494
$(obj.tree.container.dom).trigger('categoryMove.tree');
495495
}
496+
$('.page-main-actions').next('.messages').remove();
497+
$('.page-main-actions').next('#messages').remove();
498+
$('.page-main-actions').after(data.messages);
496499
}).fail(function (jqXHR, textStatus) {
497500
if (window.console) {
498501
console.log(textStatus);

app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
?>
1111

1212
<meta property="og:type" content="og:product" />
13-
<meta property="og:title" content="<?php /* @escapeNotVerified */ echo $block->stripTags($block->getProduct()->getName()); ?>" />
14-
<meta property="og:image" content="<?php /* @escapeNotVerified */ echo $block->stripTags($block->getImage($block->getProduct(), 'product_base_image')->getImageUrl()); ?>" />
15-
<meta property="og:description" content="<?php /* @escapeNotVerified */ echo $block->stripTags($block->getProduct()->getShortDescription()); ?>" />
16-
<meta property="og:url" content="<?php /* @escapeNotVerified */ echo $block->stripTags($block->getProduct()->getProductUrl()); ?>" />
13+
<meta property="og:title" content="<?php echo $block->escapeHtml($block->getProduct()->getName()); ?>" />
14+
<meta property="og:image" content="<?php echo $block->escapeUrl($block->getImage($block->getProduct(), 'product_base_image')->getImageUrl()); ?>" />
15+
<meta property="og:description" content="<?php echo $block->escapeHtml($block->getProduct()->getShortDescription()); ?>" />
16+
<meta property="og:url" content="<?php echo $block->escapeUrl($block->getProduct()->getProductUrl()); ?>" />
1717
<?php if ($priceAmount = $block->getProduct()->getFinalPrice()):?>
1818
<meta property="product:price:amount" content="<?php /* @escapeNotVerified */ echo $priceAmount; ?>"/>
1919
<?php echo $block->getChildHtml('meta.currency'); ?>

app/code/Magento/Quote/Test/Unit/Model/QuoteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ public function testBeforeSaveIsVirtualQuote(array $productTypes, $expected)
11051105
);
11061106
$items = [];
11071107
foreach ($productTypes as $type) {
1108-
$productMock = $this->getMock('\Magento\Catalog\Model\Product', [], [], '', false);;
1108+
$productMock = $this->getMock('\Magento\Catalog\Model\Product', [], [], '', false);
11091109
$productMock->expects($this->any())->method('getIsVirtual')->willReturn($type);
11101110

11111111
$itemMock = $this->getMock(

app/code/Magento/Reports/Model/ResourceModel/Quote/Collection.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function resolveCustomerNames()
156156

157157
$select->from(
158158
['customer' => $this->customerResource->getTable('customer_entity')],
159-
['email']
159+
['entity_id', 'email']
160160
);
161161
$select->columns(
162162
['customer_name' => $customerName]
@@ -171,8 +171,11 @@ public function resolveCustomerNames()
171171
$customersData = $this->customerResource->getConnection()->fetchAll($select);
172172

173173
foreach ($this->getItems() as $item) {
174-
$item->setData(array_merge($item->getData(), current($customersData)));
175-
next($customersData);
174+
foreach ($customersData as $customerItemData) {
175+
if ($item['customer_id'] == $customerItemData['entity_id']) {
176+
$item->setData(array_merge($item->getData(), $customerItemData));
177+
}
178+
}
176179
}
177180
}
178181
}

app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Quote/CollectionTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,14 @@ public function testResolveCustomerNames()
110110
$customerName = "CONCAT_WS('firstname', 'lastname')";
111111
$customerTableName = 'customer_entity';
112112
$customerId = ['customer_id' => ['test_id']];
113-
$customersData = [['item_1']];
114-
$itemData = ['test'];
113+
$customersData = [['entity_id' => 'test_id', 'name' => 'item_1']];
115114

116115
$this->selectMock->expects($this->any())
117116
->method('getConnection')
118117
->willReturn($this->connectionMock);
119118
$this->selectMock->expects($this->once())
120119
->method('from')
121-
->with(['customer' => $customerTableName], ['email'])
120+
->with(['customer' => $customerTableName], ['entity_id', 'email'])
122121
->willReturnSelf();
123122
$this->selectMock->expects($this->once())
124123
->method('columns')
@@ -158,9 +157,6 @@ public function testResolveCustomerNames()
158157
$itemMock = $this->getMockBuilder('Magento\Framework\Model\AbstractModel')
159158
->disableOriginalConstructor()
160159
->getMock();
161-
$itemMock->expects($this->once())
162-
->method('getData')
163-
->willReturn($itemData);
164160

165161
$this->entityFactoryMock->expects($this->any())
166162
->method('create')

app/code/Magento/Reports/view/adminhtml/layout/reports_report_grid.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
<block class="Magento\Backend\Block\Store\Switcher" name="adminhtml.report.grid.store_switcher" as="store_switcher">
1212
<arguments>
1313
<argument name="use_confirm" xsi:type="string">0</argument>
14-
<argument name="switch_url" xsi:type="url" path="*/*/*">
15-
<param name="store">null</param>
16-
</argument>
1714
<argument name="switch_websites" xsi:type="string">1</argument>
1815
<argument name="switch_store_groups" xsi:type="string">1</argument>
1916
<argument name="switch_store_views" xsi:type="string">1</argument>

0 commit comments

Comments
 (0)