Skip to content

Commit 34d69e7

Browse files
author
Stanislav Idolov
authored
🔃 [EngCom] Public Pull Requests - 2.1-develop
Accepted Public Pull Requests: - #15688: [Backport] Fix #4803: Incorrect return value from Product Attribute Repository (by @cream-julian) - #17439: [Backport] #12250: View.xml is inheriting image sizes from paren� (by @quisse) Fixed GitHub Issues: - #4803: Incorrect return value from Product Attribute Repository (reported by @samtay) has been fixed in #15688 by @cream-julian in 2.1-develop branch Related commits: 1. d409248 2. 90f37dc 3. b064cd7 - #12250: View.xml is inheriting image sizes from parent (so an optional field is replaced by the value of parent) (reported by @quisse) has been fixed in #17439 by @quisse in 2.1-develop branch Related commits: 1. 715d31e 2. 9c0d84f 3. fa03c60
2 parents 09385c8 + 65a7ae2 commit 34d69e7

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,16 @@ public function process(\DOMElement $mediaNode, $mediaParentTag)
3232
continue;
3333
}
3434
$attributeTagName = $attribute->tagName;
35-
if ($attributeTagName === 'background') {
36-
$nodeValue = $this->processImageBackground($attribute->nodeValue);
37-
} elseif ($attributeTagName === 'width' || $attributeTagName === 'height') {
38-
$nodeValue = intval($attribute->nodeValue);
35+
if ((bool)$attribute->getAttribute('xsi:nil') !== true) {
36+
if ($attributeTagName === 'background') {
37+
$nodeValue = $this->processImageBackground($attribute->nodeValue);
38+
} elseif ($attributeTagName === 'width' || $attributeTagName === 'height') {
39+
$nodeValue = intval($attribute->nodeValue);
40+
} else {
41+
$nodeValue = $attribute->nodeValue;
42+
}
3943
} else {
40-
$nodeValue = $attribute->nodeValue;
44+
$nodeValue = null;
4145
}
4246
$result[$mediaParentTag][$moduleNameImage][Image::MEDIA_TYPE_CONFIG_NODE][$imageId][$attribute->tagName]
4347
= $nodeValue;

app/code/Magento/Eav/Api/Data/AttributeInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
* Interface AttributeInterface
1111
* @api
1212
*/
13-
interface AttributeInterface extends \Magento\Framework\Api\CustomAttributesDataInterface
13+
interface AttributeInterface extends
14+
\Magento\Framework\Api\CustomAttributesDataInterface,
15+
\Magento\Framework\Api\MetadataObjectInterface
1416
{
1517
const ATTRIBUTE_ID = 'attribute_id';
1618

lib/internal/Magento/Framework/Config/etc/view.xsd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@
4949
<xs:element name="image" minOccurs="1" maxOccurs="unbounded">
5050
<xs:complexType>
5151
<xs:sequence>
52-
<xs:element name="width" type="xs:positiveInteger" minOccurs="0"/>
53-
<xs:element name="height" type="xs:positiveInteger" minOccurs="0"/>
54-
<xs:element name="constrain" type="xs:boolean" minOccurs="0"/>
55-
<xs:element name="aspect_ratio" type="xs:boolean" minOccurs="0"/>
56-
<xs:element name="frame" type="xs:boolean" minOccurs="0"/>
57-
<xs:element name="transparency" type="xs:boolean" minOccurs="0"/>
58-
<xs:element name="background" minOccurs="0">
52+
<xs:element name="width" type="xs:positiveInteger" minOccurs="0" nillable="true"/>
53+
<xs:element name="height" type="xs:positiveInteger" minOccurs="0" nillable="true"/>
54+
<xs:element name="constrain" type="xs:boolean" minOccurs="0" nillable="true"/>
55+
<xs:element name="aspect_ratio" type="xs:boolean" minOccurs="0" nillable="true"/>
56+
<xs:element name="frame" type="xs:boolean" minOccurs="0" nillable="true"/>
57+
<xs:element name="transparency" type="xs:boolean" minOccurs="0" nillable="true"/>
58+
<xs:element name="background" minOccurs="0" nillable="true">
5959
<xs:simpleType>
6060
<xs:restriction base="xs:string">
6161
<xs:pattern value="\[(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\]"/>

0 commit comments

Comments
 (0)