Skip to content

Commit 58bb256

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-83975' into 2.2-develop-pr34
2 parents 0c5cfd9 + 0850582 commit 58bb256

File tree

11 files changed

+317
-180
lines changed

11 files changed

+317
-180
lines changed

app/code/Magento/Bundle/Model/Product/Type.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,12 +536,12 @@ public function updateQtyOption($options, \Magento\Framework\DataObject $option,
536536

537537
foreach ($selections as $selection) {
538538
if ($selection->getProductId() == $optionProduct->getId()) {
539-
foreach ($options as &$option) {
540-
if ($option->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
539+
foreach ($options as $quoteItemOption) {
540+
if ($quoteItemOption->getCode() == 'selection_qty_' . $selection->getSelectionId()) {
541541
if ($optionUpdateFlag) {
542-
$option->setValue(intval($option->getValue()));
542+
$quoteItemOption->setValue(intval($quoteItemOption->getValue()));
543543
} else {
544-
$option->setValue($value);
544+
$quoteItemOption->setValue($value);
545545
}
546546
}
547547
}

app/code/Magento/Checkout/view/frontend/web/template/form/element/email.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
type="email"
2323
data-bind="
2424
textInput: email,
25-
hasFocus: emailFocused"
25+
hasFocus: emailFocused,
26+
mageInit: {'mage/trim-input':{}}"
2627
name="username"
2728
data-validate="{required:true, 'validate-email':true}"
2829
id="customer-email" />

app/code/Magento/Customer/Model/ResourceModel/GroupRepository.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ public function save(\Magento\Customer\Api\Data\GroupInterface $group)
156156
->setCode($groupModel->getCode())
157157
->setTaxClassId($groupModel->getTaxClassId())
158158
->setTaxClassName($groupModel->getTaxClassName());
159+
160+
if ($group->getExtensionAttributes()) {
161+
$groupDataObject->setExtensionAttributes($group->getExtensionAttributes());
162+
}
163+
159164
return $groupDataObject;
160165
}
161166

app/code/Magento/Customer/Test/Unit/Model/ResourceModel/GroupRepositoryTest.php

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ class GroupRepositoryTest extends \PHPUnit\Framework\TestCase
3838
*/
3939
protected $group;
4040

41+
/**
42+
* @var \Magento\Customer\Api\Data\GroupInterface|\PHPUnit_Framework_MockObject_MockObject
43+
*/
44+
protected $factoryCreatedGroup;
45+
4146
/**
4247
* @var \Magento\Customer\Model\ResourceModel\Group|\PHPUnit_Framework_MockObject_MockObject
4348
*/
@@ -153,6 +158,12 @@ private function setupGroupObjects()
153158
'group',
154159
false
155160
);
161+
$this->factoryCreatedGroup = $this->getMockForAbstractClass(
162+
\Magento\Customer\Api\Data\GroupInterface::class,
163+
[],
164+
'group',
165+
false
166+
);
156167

157168
$this->groupResourceModel = $this->createMock(\Magento\Customer\Model\ResourceModel\Group::class);
158169
}
@@ -162,16 +173,22 @@ public function testSave()
162173
$groupId = 0;
163174

164175
$taxClass = $this->getMockForAbstractClass(\Magento\Tax\Api\Data\TaxClassInterface::class, [], '', false);
176+
$extensionAttributes = $this->getMockForAbstractClass(
177+
\Magento\Customer\Api\Data\GroupExtensionInterface::class
178+
);
165179

166-
$this->group->expects($this->once())
180+
$this->group->expects($this->atLeastOnce())
167181
->method('getCode')
168182
->willReturn('Code');
169183
$this->group->expects($this->atLeastOnce())
170184
->method('getId')
171185
->willReturn($groupId);
172-
$this->group->expects($this->once())
186+
$this->group->expects($this->atLeastOnce())
173187
->method('getTaxClassId')
174188
->willReturn(17);
189+
$this->group->expects($this->atLeastOnce())
190+
->method('getExtensionAttributes')
191+
->willReturn($extensionAttributes);
175192

176193
$this->groupModel->expects($this->atLeastOnce())
177194
->method('getId')
@@ -185,22 +202,33 @@ public function testSave()
185202
$this->groupModel->expects($this->atLeastOnce())
186203
->method('getTaxClassName')
187204
->willReturn('Tax class name');
188-
$this->group->expects($this->once())
205+
206+
$this->factoryCreatedGroup->expects($this->once())
189207
->method('setId')
190208
->with($groupId)
191209
->willReturnSelf();
192-
$this->group->expects($this->once())
210+
$this->factoryCreatedGroup->expects($this->once())
193211
->method('setCode')
194212
->with('Code')
195213
->willReturnSelf();
196-
$this->group->expects($this->once())
214+
$this->factoryCreatedGroup->expects($this->once())
197215
->method('setTaxClassId')
198216
->with(234)
199217
->willReturnSelf();
200-
$this->group->expects($this->once())
218+
$this->factoryCreatedGroup->expects($this->once())
201219
->method('setTaxClassName')
202220
->with('Tax class name')
203221
->willReturnSelf();
222+
$this->factoryCreatedGroup->expects($this->once())
223+
->method('setExtensionAttributes')
224+
->with($extensionAttributes)
225+
->willReturnSelf();
226+
$this->factoryCreatedGroup->expects($this->atLeastOnce())
227+
->method('getCode')
228+
->willReturn('Code');
229+
$this->factoryCreatedGroup->expects($this->atLeastOnce())
230+
->method('getTaxClassId')
231+
->willReturn(17);
204232

205233
$this->taxClassRepository->expects($this->once())
206234
->method('get')
@@ -229,9 +257,12 @@ public function testSave()
229257
->with($groupId);
230258
$this->groupDataFactory->expects($this->once())
231259
->method('create')
232-
->willReturn($this->group);
260+
->willReturn($this->factoryCreatedGroup);
261+
262+
$updatedGroup = $this->model->save($this->group);
233263

234-
$this->assertSame($this->group, $this->model->save($this->group));
264+
$this->assertSame($this->group->getCode(), $updatedGroup->getCode());
265+
$this->assertSame($this->group->getTaxClassId(), $updatedGroup->getTaxClassId());
235266
}
236267

237268
/**

app/code/Magento/Customer/view/frontend/templates/form/forgotpassword.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<div class="field email required">
2121
<label for="email_address" class="label"><span><?= $block->escapeHtml(__('Email')) ?></span></label>
2222
<div class="control">
23-
<input type="email" name="email" alt="email" id="email_address" class="input-text" value="<?= $block->escapeHtmlAttr($block->getEmailValue()) ?>" data-validate="{required:true, 'validate-email':true}">
23+
<input type="email" name="email" alt="email" id="email_address" class="input-text" value="<?= $block->escapeHtmlAttr($block->getEmailValue()) ?>" data-mage-init='{"mage/trim-input":{}}' data-validate="{required:true, 'validate-email':true}">
2424
</div>
2525
</div>
2626
<?= $block->getChildHtml('form_additional_info') ?>

app/code/Magento/Developer/Model/Di/PluginList.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ private function addPluginToList($pluginInstance, $pluginMethod, $methodTypes, $
145145
if (!array_key_exists($pluginInstance, $this->pluginList[$this->pluginTypeMapping[$typeCode]])) {
146146
$this->pluginList[$this->pluginTypeMapping[$typeCode]][$pluginInstance] = [];
147147
}
148-
$this->pluginList[$this->pluginTypeMapping[$typeCode]][$pluginInstance][] = $pluginMethod ;
148+
149+
if (!in_array($pluginMethod, $this->pluginList[$this->pluginTypeMapping[$typeCode]][$pluginInstance])) {
150+
$this->pluginList[$this->pluginTypeMapping[$typeCode]][$pluginInstance][] = $pluginMethod;
151+
}
149152
}
150153
}
151154
}

app/code/Magento/SendFriend/view/frontend/templates/send.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<div class="control">
3636
<input name="recipients[email][<%- data._index_ %>]" title="<?= $block->escapeHtmlAttr(__('Email')) ?>"
3737
id="recipients-email<%- data._index_ %>" type="email" class="input-text"
38+
data-mage-init='{"mage/trim-input":{}}'
3839
data-validate="{required:true, 'validate-email':true}"/>
3940
</div>
4041
</div>
@@ -72,7 +73,8 @@
7273
<label for="sender-email" class="label"><span><?= $block->escapeHtml(__('Email')) ?></span></label>
7374
<div class="control">
7475
<input name="sender[email]" value="<?= $block->escapeHtmlAttr($block->getEmail()) ?>"
75-
title="<?= $block->escapeHtmlAttr(__('Email')) ?>" id="sender-email" type="text" class="input-text"
76+
title="<?= $block->escapeHtmlAttr(__('Email')) ?>" id="sender-email" type="email" class="input-text"
77+
data-mage-init='{"mage/trim-input":{}}'
7678
data-validate="{required:true, 'validate-email':true}"/>
7779
</div>
7880
</div>

app/code/Magento/Theme/view/frontend/web/js/row-builder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ define([
144144

145145
$(tmpl).appendTo(row);
146146

147-
$(this.options.rowContainer).append(row);
147+
$(this.options.rowContainer).append(row).trigger('contentUpdated');
148148

149149
row.addClass(this.options.additionalRowClass);
150150

0 commit comments

Comments
 (0)