Skip to content

Commit 9d75bca

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1661 from magento-engcom/2.1-develop-prs
Public Pull Requests #11960 [Backport 2.1] #11898 - Change NL PostCode Pattern by @osrecio #11920 [BACKPORT 2.1] [TASK] Add resetPassword call to the webapi by @lewisvoncken #11890 Save background color correctly in images. [backport 2.1] by @raumatbel Fixed Public Issues #11898 Zip code Netherlands should allow zipcode without space #8799 Image brackground
2 parents 9bc8f13 + a870086 commit 9d75bca

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
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/Customer/etc/webapi.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@
188188
<resource ref="anonymous"/>
189189
</resources>
190190
</route>
191+
<route url="/V1/customers/resetPassword" method="POST">
192+
<service class="Magento\Customer\Api\AccountManagementInterface" method="resetPassword"/>
193+
<resources>
194+
<resource ref="anonymous"/>
195+
</resources>
196+
</route>
191197
<route url="/V1/customers/:customerId/confirm" method="GET">
192198
<service class="Magento\Customer\Api\AccountManagementInterface" method="getConfirmationStatus"/>
193199
<resources>

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

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

0 commit comments

Comments
 (0)