Skip to content

Commit fd72ad0

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-90301' into MAGETWO-90301
# Conflicts: # dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Checkout/Test/CheckCheckoutSuccessPageTest.xml
2 parents 104cad4 + bad70a1 commit fd72ad0

File tree

195 files changed

+3801
-911
lines changed

Some content is hidden

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

195 files changed

+3801
-911
lines changed

app/code/Magento/AdminNotification/view/adminhtml/templates/system/messages/popup.phtml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,12 @@
1919
</ul>
2020
</div>
2121

22-
<script>
23-
require([
24-
"jquery",
25-
"Magento_Ui/js/modal/modal"
26-
], function($){
27-
if (this.modal) {
28-
this.modal.html($('[data-role="system_messages_list"]').html());
29-
} else {
30-
this.modal = $('[data-role="system_messages_list"]').modal({
31-
modalClass: 'modal-system-messages ui-popup-message',
32-
type: 'popup',
33-
buttons: []
34-
});
22+
<script type="text/x-magento-init">
23+
{
24+
"[data-role=system_messages_list]": {
25+
"Magento_AdminNotification/js/system/messages/popup": {
26+
class: 'modal-system-messages ui-popup-message'
27+
}
28+
}
3529
}
36-
this.modal.modal('openModal');
37-
});
38-
</script>
30+
</script>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery',
8+
'Magento_Ui/js/modal/modal'
9+
], function ($) {
10+
'use strict';
11+
12+
return function (data, element) {
13+
if (this.modal) {
14+
this.modal.html($(element).html());
15+
} else {
16+
this.modal = $(element).modal({
17+
modalClass: data.class,
18+
type: 'popup',
19+
buttons: []
20+
});
21+
}
22+
this.modal.modal('openModal');
23+
};
24+
});

app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ public function execute()
3737
try {
3838
$model->delete();
3939

40-
$this->_eventManager->dispatch('store_delete', ['store' => $model]);
41-
4240
$this->messageManager->addSuccess(__('You deleted the store view.'));
4341
return $redirectResult->setPath('adminhtml/*/');
4442
} catch (\Magento\Framework\Exception\LocalizedException $e) {

app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ private function processWebsiteSave($postData)
4646
*/
4747
private function processStoreSave($postData)
4848
{
49-
$eventName = 'store_edit';
5049
/** @var \Magento\Store\Model\Store $storeModel */
5150
$storeModel = $this->_objectManager->create(\Magento\Store\Model\Store::class);
5251
$postData['store']['name'] = $this->filterManager->removeTags($postData['store']['name']);
@@ -56,7 +55,6 @@ private function processStoreSave($postData)
5655
$storeModel->setData($postData['store']);
5756
if ($postData['store']['store_id'] == '') {
5857
$storeModel->setId(null);
59-
$eventName = 'store_add';
6058
}
6159
$groupModel = $this->_objectManager->create(
6260
\Magento\Store\Model\Group::class
@@ -70,8 +68,6 @@ private function processStoreSave($postData)
7068
);
7169
}
7270
$storeModel->save();
73-
$this->_objectManager->get(\Magento\Store\Model\StoreManager::class)->reinitStores();
74-
$this->_eventManager->dispatch($eventName, ['store' => $storeModel]);
7571
$this->messageManager->addSuccess(__('You saved the store view.'));
7672

7773
return $postData;
@@ -102,7 +98,6 @@ private function processGroupSave($postData)
10298
);
10399
}
104100
$groupModel->save();
105-
$this->_eventManager->dispatch('store_group_save', ['group' => $groupModel]);
106101
$this->messageManager->addSuccess(__('You saved the store.'));
107102

108103
return $postData;

app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function setCollection($collection)
196196
$this->_collection->addAttributeToSort(
197197
$this->getCurrentOrder(),
198198
$this->getCurrentDirection()
199-
)->addAttributeToSort('entity_id', $this->getCurrentDirection());
199+
);
200200
} else {
201201
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
202202
}

app/code/Magento/Catalog/Controller/Adminhtml/Product/Save.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ private function handleImageRemoveError($postData, $productId)
216216
/**
217217
* Do copying data to stores
218218
*
219+
* If the 'copy_from' field is not specified in the input data,
220+
* the store fallback mechanism will automatically take the admin store's default value.
221+
*
219222
* @param array $data
220223
* @param int $productId
221224
* @return void
@@ -227,15 +230,17 @@ protected function copyToStores($data, $productId)
227230
if (isset($data['product']['website_ids'][$websiteId])
228231
&& (bool)$data['product']['website_ids'][$websiteId]) {
229232
foreach ($group as $store) {
230-
$copyFrom = (isset($store['copy_from'])) ? $store['copy_from'] : 0;
231-
$copyTo = (isset($store['copy_to'])) ? $store['copy_to'] : 0;
232-
if ($copyTo) {
233-
$this->_objectManager->create(\Magento\Catalog\Model\Product::class)
234-
->setStoreId($copyFrom)
235-
->load($productId)
236-
->setStoreId($copyTo)
237-
->setCopyFromView(true)
238-
->save();
233+
if (isset($store['copy_from'])) {
234+
$copyFrom = $store['copy_from'];
235+
$copyTo = (isset($store['copy_to'])) ? $store['copy_to'] : 0;
236+
if ($copyTo) {
237+
$this->_objectManager->create(\Magento\Catalog\Model\Product::class)
238+
->setStoreId($copyFrom)
239+
->load($productId)
240+
->setStoreId($copyTo)
241+
->setCopyFromView(true)
242+
->save();
243+
}
239244
}
240245
}
241246
}

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

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,17 @@ public function deleteEntity(\Magento\Framework\Model\AbstractModel $object)
141141
->getMetadata(ProductInterface::class)
142142
->getLinkField();
143143

144-
$select = $this->getConnection()->select()->from(
145-
$attribute->getEntity()->getEntityTable(),
146-
$linkField
147-
)->where(
148-
'attribute_set_id = ?',
149-
$result['attribute_set_id']
150-
);
144+
$backendLinkField = $attribute->getBackend()->getEntityIdField();
151145

152-
$clearCondition = [
153-
'attribute_id =?' => $attribute->getId(),
154-
$linkField . ' IN (?)' => $select,
155-
];
156-
$this->getConnection()->delete($backendTable, $clearCondition);
146+
$select = $this->getConnection()->select()
147+
->from(['b' => $backendTable])
148+
->join(
149+
['e' => $attribute->getEntity()->getEntityTable()],
150+
"b.$backendLinkField = e.$linkField"
151+
)->where('b.attribute_id = ?', $attribute->getId())
152+
->where('e.attribute_set_id = ?', $result['attribute_set_id']);
153+
154+
$this->getConnection()->query($select->deleteFromSelect('b'));
157155
}
158156
}
159157

0 commit comments

Comments
 (0)