Skip to content

Commit

Permalink
Merge pull request magento#1661 from magento-engcom/2.1-develop-prs
Browse files Browse the repository at this point in the history
Public Pull Requests

magento#11960 [Backport 2.1] magento#11898 - Change NL PostCode Pattern by @osrecio
magento#11920 [BACKPORT 2.1] [TASK] Add resetPassword call to the webapi by @lewisvoncken
magento#11890 Save background color correctly in images. [backport 2.1] by @raumatbel

Fixed Public Issues

magento#11898 Zip code Netherlands should allow zipcode without space
magento#8799 Image brackground
  • Loading branch information
Oleksii Korshenko authored Nov 3, 2017
2 parents 9bc8f13 + a870086 commit 9d75bca
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
11 changes: 8 additions & 3 deletions app/code/Magento/Catalog/Model/ImageExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
*/
namespace Magento\Catalog\Model;

use Magento\Catalog\Model\Product\Attribute\Backend\Media\ImageEntryConverter;
use Magento\Catalog\Helper\Image;
use Magento\Catalog\Model\Product\Attribute\Backend\Media\ImageEntryConverter;
use Magento\Framework\View\Xsd\Media\TypeDataExtractorInterface;

class ImageExtractor implements \Magento\Framework\View\Xsd\Media\TypeDataExtractorInterface
class ImageExtractor implements TypeDataExtractorInterface
{
/**
* Extract configuration data of images from the DOM structure
Expand All @@ -30,8 +31,11 @@ public function process(\DOMElement $mediaNode, $mediaParentTag)
if ($attribute->nodeType != XML_ELEMENT_NODE) {
continue;
}
if ($attribute->tagName == 'background') {
$attributeTagName = $attribute->tagName;
if ($attributeTagName === 'background') {
$nodeValue = $this->processImageBackground($attribute->nodeValue);
} elseif ($attributeTagName === 'width' || $attributeTagName === 'height') {
$nodeValue = intval($attribute->nodeValue);
} else {
$nodeValue = $attribute->nodeValue;
}
Expand All @@ -55,6 +59,7 @@ private function processImageBackground($backgroundString)
$backgroundArray = [];
if (preg_match($pattern, $backgroundString, $backgroundArray)) {
array_shift($backgroundArray);
$backgroundArray = array_map('intval', $backgroundArray);
}
return $backgroundArray;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function setUp()
public function testProcess()
{
$expectedArray = include(__DIR__ . '/_files/converted_view.php');
$this->assertEquals($expectedArray, $this->model->process($this->getDomElement(), 'media'));
$this->assertSame($expectedArray, $this->model->process($this->getDomElement(), 'media'));
}

/**
Expand Down
6 changes: 6 additions & 0 deletions app/code/Magento/Customer/etc/webapi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@
<resource ref="anonymous"/>
</resources>
</route>
<route url="/V1/customers/resetPassword" method="POST">
<service class="Magento\Customer\Api\AccountManagementInterface" method="resetPassword"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>
<route url="/V1/customers/:customerId/confirm" method="GET">
<service class="Magento\Customer\Api\AccountManagementInterface" method="getConfirmationStatus"/>
<resources>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Directory/etc/zip_codes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
</zip>
<zip countryCode="NL">
<codes>
<code id="pattern_1" active="true" example="1234 AB">^[0-9]{4}\s[a-zA-Z]{2}$</code>
<code id="pattern_1" active="true" example="1234 AB/1234AB">^[1-9][0-9]{3}\s?[a-zA-Z]{2}$</code>
</codes>
</zip>
<zip countryCode="NO">
Expand Down

0 comments on commit 9d75bca

Please sign in to comment.