Skip to content

Commit 4d111d2

Browse files
committed
#10789: Merge branch 'develop' of github.com:magento/magento2 into MAGETWO-72341-PR-10789
2 parents 08d67f4 + 75155ae commit 4d111d2

File tree

5 files changed

+135
-9
lines changed

5 files changed

+135
-9
lines changed

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,15 +407,19 @@ define([
407407
* - associated_product_ids_serialized.
408408
*/
409409
serializeData: function () {
410-
this.source.data['configurable-matrix-serialized'] =
411-
JSON.stringify(this.source.data['configurable-matrix']);
410+
if (this.source.data['configurable-matrix']) {
411+
this.source.data['configurable-matrix-serialized'] =
412+
JSON.stringify(this.source.data['configurable-matrix']);
412413

413-
delete this.source.data['configurable-matrix'];
414+
delete this.source.data['configurable-matrix'];
415+
}
414416

415-
this.source.data['associated_product_ids_serialized'] =
416-
JSON.stringify(this.source.data['associated_product_ids']);
417+
if (this.source.data['associated_product_ids']) {
418+
this.source.data['associated_product_ids_serialized'] =
419+
JSON.stringify(this.source.data['associated_product_ids']);
417420

418-
delete this.source.data['associated_product_ids'];
421+
delete this.source.data['associated_product_ids'];
422+
}
419423
},
420424

421425
/**

app/code/Magento/Customer/Model/Url.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public function getForgotPasswordUrl()
237237
*/
238238
public function getEmailConfirmationUrl($email = null)
239239
{
240-
return $this->urlBuilder->getUrl('customer/account/confirmation', ['email' => $email]);
240+
return $this->urlBuilder->getUrl('customer/account/confirmation', ['_query' => ['email' => $email]]);
241241
}
242242

243243
/**

app/code/Magento/Store/Model/Store.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ class Store extends AbstractExtensibleModel implements
207207
* Flag that shows that backend URLs are secure
208208
*
209209
* @var boolean|null
210+
* @deprecated unused protected property
210211
*/
211212
protected $_isAdminSecure = null;
212213

dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,8 @@ public function testWithConfirmCreatePostAction()
304304
$this->assertSessionMessages(
305305
$this->equalTo([
306306
'You must confirm your account. Please check your email for the confirmation link or '
307-
. '<a href="http://localhost/index.php/customer/account/confirmation/email/'
308-
. 'test2%40email.com/">click here</a> for a new link.'
307+
. '<a href="http://localhost/index.php/customer/account/confirmation/'
308+
. '?email=test2%40email.com">click here</a> for a new link.'
309309
]),
310310
MessageInterface::TYPE_SUCCESS
311311
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'Magento_ConfigurableProduct/js/variations/variations'
8+
], function (Variations) {
9+
'use strict';
10+
11+
describe('Magento_ConfigurableProduct/js/variations/variations', function () {
12+
var variation;
13+
14+
beforeEach(function () {
15+
variation = new Variations();
16+
17+
variation.source = {
18+
data: {}
19+
};
20+
});
21+
22+
it('checks that "serializeData" serializes data', function () {
23+
var matrix = [
24+
{
25+
name: 'Product1',
26+
attributes: 'Color: black',
27+
price: 100
28+
},
29+
{
30+
name: 'Product2',
31+
attributes: 'Color: red',
32+
price: 50
33+
},
34+
{
35+
name: 'Product3',
36+
attributes: 'Color: white',
37+
price: 20
38+
}
39+
],
40+
ids = [1, 2, 3],
41+
resultMatrix = JSON.stringify(matrix),
42+
resultIds = JSON.stringify(ids);
43+
44+
variation.source.data['configurable-matrix'] = matrix;
45+
variation.source.data['associated_product_ids'] = ids;
46+
47+
variation.serializeData();
48+
49+
expect(variation.source.data['configurable-matrix']).toBeUndefined();
50+
expect(variation.source.data['associated_product_ids']).toBeUndefined();
51+
expect(variation.source.data['configurable-matrix-serialized']).toEqual(resultMatrix);
52+
expect(variation.source.data['associated_product_ids_serialized']).toEqual(resultIds);
53+
});
54+
55+
it('checks that "serializeData" uses old data if there is no data to serialize', function () {
56+
57+
var matrix = [
58+
{
59+
name: 'Product4',
60+
attributes: 'Color: grey',
61+
price: 5
62+
},
63+
{
64+
name: 'Product5',
65+
attributes: 'Color: pink',
66+
price: 70
67+
},
68+
{
69+
name: 'Product6',
70+
attributes: 'Color: brown',
71+
price: 30
72+
}
73+
],
74+
ids = [4, 5, 6],
75+
resultMatrix = JSON.stringify(matrix),
76+
resultIds = JSON.stringify(ids);
77+
78+
variation.source.data['configurable-matrix-serialized'] = JSON.stringify(matrix);
79+
variation.source.data['associated_product_ids_serialized'] = JSON.stringify(ids);
80+
81+
variation.serializeData();
82+
83+
expect(variation.source.data['configurable-matrix-serialized']).toEqual(resultMatrix);
84+
expect(variation.source.data['associated_product_ids_serialized']).toEqual(resultIds);
85+
});
86+
87+
it('checks that "serializeData" works correctly if we have new data to be serialized', function () {
88+
var matrix = [
89+
{
90+
name: 'Product7',
91+
attributes: 'Color: yellow',
92+
price: 10
93+
},
94+
{
95+
name: 'Product8',
96+
attributes: 'Color: green',
97+
price: 200
98+
},
99+
{
100+
name: 'Product9',
101+
attributes: 'Color: blue',
102+
price: 500
103+
}
104+
],
105+
ids = [7, 8, 9],
106+
resultMatrix = JSON.stringify(matrix),
107+
resultIds = JSON.stringify(ids);
108+
109+
variation.source.data['configurable-matrix'] = matrix;
110+
variation.source.data['associated_product_ids'] = ids;
111+
variation.source.data['configurable-matrix-serialized'] = JSON.stringify(['some old data']);
112+
variation.source.data['associated_product_ids_serialized'] = JSON.stringify(['some old data']);
113+
variation.serializeData();
114+
115+
expect(variation.source.data['configurable-matrix']).toBeUndefined();
116+
expect(variation.source.data['associated_product_ids']).toBeUndefined();
117+
expect(variation.source.data['configurable-matrix-serialized']).toEqual(resultMatrix);
118+
expect(variation.source.data['associated_product_ids_serialized']).toEqual(resultIds);
119+
});
120+
});
121+
});

0 commit comments

Comments
 (0)