Skip to content

Commit 0b2196e

Browse files
Merge branch '2.2-develop' of github.com:magento/magento2ce into MAGETWO-80191
2 parents a55c85f + 0483421 commit 0b2196e

File tree

16 files changed

+98
-38
lines changed

16 files changed

+98
-38
lines changed

app/code/Magento/Catalog/Model/ImageExtractor.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
*/
66
namespace Magento\Catalog\Model;
77

8-
use Magento\Catalog\Model\Product\Attribute\Backend\Media\ImageEntryConverter;
98
use Magento\Catalog\Helper\Image;
9+
use Magento\Catalog\Model\Product\Attribute\Backend\Media\ImageEntryConverter;
10+
use Magento\Framework\View\Xsd\Media\TypeDataExtractorInterface;
1011

11-
class ImageExtractor implements \Magento\Framework\View\Xsd\Media\TypeDataExtractorInterface
12+
class ImageExtractor implements TypeDataExtractorInterface
1213
{
1314
/**
1415
* Extract configuration data of images from the DOM structure
@@ -30,8 +31,11 @@ public function process(\DOMElement $mediaNode, $mediaParentTag)
3031
if ($attribute->nodeType != XML_ELEMENT_NODE) {
3132
continue;
3233
}
33-
if ($attribute->tagName == 'background') {
34+
$attributeTagName = $attribute->tagName;
35+
if ($attributeTagName === 'background') {
3436
$nodeValue = $this->processImageBackground($attribute->nodeValue);
37+
} elseif ($attributeTagName === 'width' || $attributeTagName === 'height') {
38+
$nodeValue = intval($attribute->nodeValue);
3539
} else {
3640
$nodeValue = $attribute->nodeValue;
3741
}
@@ -55,6 +59,7 @@ private function processImageBackground($backgroundString)
5559
$backgroundArray = [];
5660
if (preg_match($pattern, $backgroundString, $backgroundArray)) {
5761
array_shift($backgroundArray);
62+
$backgroundArray = array_map('intval', $backgroundArray);
5863
}
5964
return $backgroundArray;
6065
}

app/code/Magento/Catalog/Test/Unit/Model/ImageExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function setUp()
2323
public function testProcess()
2424
{
2525
$expectedArray = include(__DIR__ . '/_files/converted_view.php');
26-
$this->assertEquals($expectedArray, $this->model->process($this->getDomElement(), 'media'));
26+
$this->assertSame($expectedArray, $this->model->process($this->getDomElement(), 'media'));
2727
}
2828

2929
/**

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,11 @@ function switchDefaultValueField()
196196

197197
<?php foreach ($this->helper('Magento\Catalog\Helper\Data')->getAttributeHiddenFields() as $type => $fields): ?>
198198
case '<?= /* @escapeNotVerified */ $type ?>':
199+
var isFrontTabHidden = false;
199200
<?php foreach ($fields as $one): ?>
200201
<?php if ($one == '_front_fieldset'): ?>
201202
getFrontTab().hide();
203+
isFrontTabHidden = true;
202204
<?php elseif ($one == '_default_value'): ?>
203205
defaultValueTextVisibility =
204206
defaultValueTextareaVisibility =
@@ -210,6 +212,10 @@ function switchDefaultValueField()
210212
setRowVisibility('<?= /* @escapeNotVerified */ $one ?>', false);
211213
<?php endif; ?>
212214
<?php endforeach; ?>
215+
216+
if (!isFrontTabHidden){
217+
getFrontTab().show();
218+
}
213219
break;
214220
<?php endforeach; ?>
215221

app/code/Magento/Customer/etc/adminhtml/system.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@
198198
<field id="street_lines" translate="label comment" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
199199
<label>Number of Lines in a Street Address</label>
200200
<backend_model>Magento\Customer\Model\Config\Backend\Address\Street</backend_model>
201-
<comment>Leave empty for default (2). Valid range: 1-4</comment>
201+
<comment>Valid range: 1-4</comment>
202+
<validate>required-entry validate-digits validate-digits-range digits-range-1-4</validate>
202203
</field>
203204
<field id="prefix_show" translate="label comment" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="0">
204205
<label>Show Prefix</label>

app/code/Magento/Customer/etc/webapi.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@
194194
<resource ref="anonymous"/>
195195
</resources>
196196
</route>
197+
<route url="/V1/customers/resetPassword" method="POST">
198+
<service class="Magento\Customer\Api\AccountManagementInterface" method="resetPassword"/>
199+
<resources>
200+
<resource ref="anonymous"/>
201+
</resources>
202+
</route>
197203
<route url="/V1/customers/:customerId/confirm" method="GET">
198204
<service class="Magento\Customer\Api\AccountManagementInterface" method="getConfirmationStatus"/>
199205
<resources>

app/code/Magento/Directory/etc/zip_codes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@
319319
</zip>
320320
<zip countryCode="NL">
321321
<codes>
322-
<code id="pattern_1" active="true" example="1234 AB">^[0-9]{4}\s?[a-zA-Z]{2}$</code>
322+
<code id="pattern_1" active="true" example="1234 AB/1234AB">^[1-9][0-9]{3}\s?[a-zA-Z]{2}$</code>
323323
</codes>
324324
</zip>
325325
<zip countryCode="NO">

app/code/Magento/Eav/Model/Entity/AbstractEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ public function checkAttributeUniqueValue(AbstractAttribute $attribute, $object)
908908
'value' => trim($value),
909909
];
910910

911-
$entityIdField = $attributeBackend->getEntityIdField();
911+
$entityIdField = $object->getResource()->getLinkField();
912912
$select->from(
913913
$attributeBackend->getTable(),
914914
$entityIdField

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function _construct()
101101
*/
102102
public function getStoreId()
103103
{
104-
return (int)$this->_quote->getStoreId();
104+
return (int)$this->_productCollectionFactory->create()->getStoreId();
105105
}
106106

107107
/**

app/code/Magento/Reports/Setup/InstallData.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
8383
// @codingStandardsIgnoreStart
8484
$reportLayoutUpdate = '<!--
8585
<referenceContainer name="right">
86-
<action method="unsetChild"><argument name="alias" xsi:type="string">right.reports.product.viewed</argument></action>
87-
<action method="unsetChild"><argument name="alias" xsi:type="string">right.reports.product.compared</argument></action>
86+
<referenceBlock name="catalog.compare.sidebar" remove="true" />
8887
</referenceContainer>-->';
8988
// @codingStandardsIgnoreEnd
9089

app/code/Magento/Sales/view/adminhtml/web/order/create/scripts.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ define([
5555
}
5656
});
5757

58-
var searchButton = new ControlButton(jQuery.mage.__('Add Products')),
58+
var searchButtonId = 'add_products',
59+
searchButton = new ControlButton(jQuery.mage.__('Add Products'), searchButtonId),
5960
searchAreaId = this.getAreaId('search');
6061
searchButton.onClick = function() {
6162
$(searchAreaId).show();
@@ -74,7 +75,7 @@ define([
7475

7576
this.itemsArea.onLoad = this.itemsArea.onLoad.wrap(function(proceed) {
7677
proceed();
77-
if ($(searchAreaId) && !$(searchAreaId).visible()) {
78+
if ($(searchAreaId) && !$(searchAreaId).visible() && !$(searchButtonId)) {
7879
this.addControlButton(searchButton);
7980
}
8081
});
@@ -1394,12 +1395,15 @@ define([
13941395
_label: '',
13951396
_node: null,
13961397

1397-
initialize: function(label){
1398+
initialize: function(label, id){
13981399
this._label = label;
13991400
this._node = new Element('button', {
14001401
'class': 'action-secondary action-add',
14011402
'type': 'button'
14021403
});
1404+
if (typeof id !== 'undefined') {
1405+
this._node.setAttribute('id', id)
1406+
}
14031407
},
14041408

14051409
onClick: function(){

0 commit comments

Comments
 (0)