Skip to content

Commit ba4be84

Browse files
committed
MAGETWO-56018: [GitHub] Fail to import custom options #5573
2 parents 0df8184 + d7e0eb4 commit ba4be84

File tree

14 files changed

+57
-21
lines changed

14 files changed

+57
-21
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
@@ -66,7 +66,6 @@
6666
</type>
6767
<type name="Magento\Catalog\Model\Indexer\Category\Product\Action\Full">
6868
<plugin name="invalidate_pagecache_after_full_reindex" type="Magento\Catalog\Plugin\Model\Indexer\Category\Product\Execute" />
69-
<plugin name="max_heap_tablse_size_processor_on_full_reindex" type="Magento\Catalog\Plugin\Model\Indexer\Category\Product\MaxHeapTableSizeProcessorOnFullReindex"/>
7069
</type>
7170
<type name="Magento\Catalog\Model\ResourceModel\Attribute">
7271
<plugin name="invalidate_pagecache_after_attribute_save" type="Magento\Catalog\Plugin\Model\ResourceModel\Attribute\Save" />

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/set/main.phtml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,13 @@
313313
},
314314

315315
save : function() {
316+
var block;
317+
316318
if ($('messages')) {
317319
$('messages').update();
320+
} else {
321+
block = jQuery('<div/>').attr('id', 'messages');
322+
jQuery('.page-main-actions').after(block);
318323
}
319324
TreePanels.rebuildTrees();
320325
if(!jQuery('#set-prop-form').valid()) {

app/code/Magento/Sales/Model/AdminOrder/Create.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ protected function _createCustomerForm(\Magento\Customer\Api\Data\CustomerInterf
12841284
'adminhtml_checkout',
12851285
$this->customerMapper->toFlatArray($customer),
12861286
false,
1287-
CustomerForm::DONT_IGNORE_INVISIBLE
1287+
CustomerForm::IGNORE_INVISIBLE
12881288
);
12891289

12901290
return $customerForm;
@@ -1559,13 +1559,11 @@ public function setAccountData($accountData)
15591559
{
15601560
$customer = $this->getQuote()->getCustomer();
15611561
$form = $this->_createCustomerForm($customer);
1562-
$customerData = $this->customerMapper->toFlatArray($customer);
15631562

15641563
// emulate request
15651564
$request = $form->prepareRequest($accountData);
15661565
$data = $form->extractData($request);
15671566
$data = $form->restoreData($data);
1568-
$data = array_merge($customerData, array_filter($data));
15691567
$customer = $this->customerFactory->create();
15701568
$this->dataObjectHelper->populateWithArray(
15711569
$customer,
@@ -1575,6 +1573,7 @@ public function setAccountData($accountData)
15751573
$this->getQuote()->updateCustomerData($customer);
15761574
$data = [];
15771575

1576+
$customerData = $this->customerMapper->toFlatArray($customer);
15781577
foreach ($form->getAttributes() as $attribute) {
15791578
$code = sprintf('customer_%s', $attribute->getAttributeCode());
15801579
$data[$code] = isset($customerData[$attribute->getAttributeCode()])

app/code/Magento/Sales/Test/Unit/Model/AdminOrder/CreateTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,11 @@ public function testSetAccountData()
243243
);
244244
$customerGroupMock->expects($this->once())->method('getTaxClassId')->will($this->returnValue($taxClassId));
245245
$customerFormMock = $this->getMock('Magento\Customer\Model\Metadata\Form', [], [], '', false);
246-
$customerFormMock->expects($this->any())->method('getAttributes')->will($this->returnValue($attributeMocks));
246+
$customerFormMock->expects($this->any())
247+
->method('getAttributes')
248+
->will($this->returnValue([$attributeMocks[1]]));
247249
$customerFormMock->expects($this->any())->method('extractData')->will($this->returnValue([]));
248-
$customerFormMock->expects($this->any())->method('restoreData')->will($this->returnValue([]));
250+
$customerFormMock->expects($this->any())->method('restoreData')->will($this->returnValue(['group_id' => 1]));
249251

250252
$customerFormMock->expects($this->any())
251253
->method('prepareRequest')
@@ -254,7 +256,7 @@ public function testSetAccountData()
254256
$customerMock = $this->getMock('Magento\Customer\Api\Data\CustomerInterface', [], [], '', false);
255257
$this->customerMapper->expects($this->atLeastOnce())
256258
->method('toFlatArray')
257-
->willReturn(['email' => '[email protected]', 'group_id' => 1, 'gender' => 1]);
259+
->willReturn(['group_id' => 1]);
258260

259261

260262
$quoteMock = $this->getMock('Magento\Quote\Model\Quote', [], [], '', false);
@@ -263,7 +265,6 @@ public function testSetAccountData()
263265
->method('addData')
264266
->with(
265267
[
266-
'customer_email' => $attributes[0][1],
267268
'customer_group_id' => $attributes[1][1],
268269
'customer_tax_class_id' => $taxClassId
269270
]
@@ -272,7 +273,7 @@ public function testSetAccountData()
272273
->method('populateWithArray')
273274
->with(
274275
$customerMock,
275-
['email' => '[email protected]', 'group_id' => 1, 'gender' => 1],
276+
['group_id' => 1],
276277
'\Magento\Customer\Api\Data\CustomerInterface'
277278
);
278279

@@ -284,7 +285,7 @@ public function testSetAccountData()
284285
->method('getById')
285286
->will($this->returnValue($customerGroupMock));
286287

287-
$this->adminOrderCreate->setAccountData([]);
288+
$this->adminOrderCreate->setAccountData(['group_id' => 1]);
288289
}
289290

290291
public function testUpdateQuoteItemsNotArray()

app/code/Magento/Sales/view/frontend/email/order_new.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"layout handle=\"sales_email_order_items\" order=$order area=\"frontend\"":"Order Items Grid",
1313
"var payment_html|raw":"Payment Details",
1414
"var formattedShippingAddress|raw":"Shipping Address",
15-
"var order.getShippingDescription()":"Shipping Description"
15+
"var order.getShippingDescription()":"Shipping Description",
1616
"var shipping_msg":"Shipping message"
1717
} @-->
1818

app/code/Magento/Sales/view/frontend/email/order_new_guest.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
1515
"var payment_html|raw":"Payment Details",
1616
"var formattedShippingAddress|raw":"Shipping Address",
17-
"var order.getShippingDescription()":"Shipping Description"
17+
"var order.getShippingDescription()":"Shipping Description",
1818
"var shipping_msg":"Shipping message"
1919
} @-->
2020
{{template config_path="design/email/header_template"}}

app/code/Magento/Theme/view/frontend/web/js/view/messages.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,35 @@
55
define([
66
'jquery',
77
'uiComponent',
8+
'underscore',
89
'Magento_Customer/js/customer-data',
910
'jquery/jquery-storageapi'
10-
], function ($, Component, customerData) {
11+
], function ($, Component, _, customerData) {
1112
'use strict';
1213

1314
return Component.extend({
1415
defaults: {
1516
cookieMessages: [],
1617
messages: []
1718
},
19+
20+
/** @inheritdoc */
1821
initialize: function () {
1922
this._super();
2023

2124
this.cookieMessages = $.cookieStorage.get('mage-messages');
22-
this.messages = customerData.get('messages').extend({disposableCustomerData: 'messages'});
23-
$.cookieStorage.setConf({path: '/', expires: -1}).set('mage-messages', null);
25+
this.messages = customerData.get('messages').extend({
26+
disposableCustomerData: 'messages'
27+
});
28+
29+
if (!_.isEmpty(this.messages().messages)) {
30+
customerData.set('messages', {});
31+
}
32+
33+
$.cookieStorage.setConf({
34+
path: '/',
35+
expires: -1
36+
}).set('mage-messages', null);
2437
}
2538
});
2639
});

app/design/frontend/Magento/luma/Magento_Sales/email/order_new.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"layout handle=\"sales_email_order_items\" order=$order area=\"frontend\"":"Order Items Grid",
1313
"var payment_html|raw":"Payment Details",
1414
"var formattedShippingAddress|raw":"Shipping Address",
15-
"var order.getShippingDescription()":"Shipping Description"
15+
"var order.getShippingDescription()":"Shipping Description",
1616
"var shipping_msg":"Shipping message"
1717
} @-->
1818

app/design/frontend/Magento/luma/Magento_Sales/email/order_new_guest.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"layout handle=\"sales_email_order_items\" order=$order":"Order Items Grid",
1515
"var payment_html|raw":"Payment Details",
1616
"var formattedShippingAddress|raw":"Shipping Address",
17-
"var order.getShippingDescription()":"Shipping Description"
17+
"var order.getShippingDescription()":"Shipping Description",
1818
"var shipping_msg":"Shipping message"
1919
} @-->
2020
{{template config_path="design/email/header_template"}}

lib/web/fotorama/fotorama.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,8 +1433,14 @@ fotoramaVersion = '4.6.4';
14331433
xWin = (tail.go || tail.x || xyDiff >= 0) && !tail.noSwipe,
14341434
yWin = xyDiff < 0;
14351435

1436-
stopEvent(e);
1437-
(options.onMove || noop).call(el, e, {touch: touchFLAG});
1436+
if (touchFLAG && !tail.checked) {
1437+
if (touchEnabledFLAG = xWin) {
1438+
stopEvent(e);
1439+
}
1440+
} else {
1441+
stopEvent(e);
1442+
(options.onMove || noop).call(el, e, {touch: touchFLAG});
1443+
}
14381444

14391445
if (!moved && Math.sqrt(Math.pow(xDiff, 2) + Math.pow(yDiff, 2)) > tolerance) {
14401446
moved = true;

lib/web/fotorama/fotorama.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)