Skip to content

Commit fa03c60

Browse files
author
Tommy Quissens
committed
made more attributes nillable
1 parent 9c0d84f commit fa03c60

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +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-
if ((bool)$attribute->getAttribute('xsi:nil') !== true) {
39-
$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);
4040
} else {
41-
$nodeValue = null;
41+
$nodeValue = $attribute->nodeValue;
4242
}
4343
} else {
44-
$nodeValue = $attribute->nodeValue;
44+
$nodeValue = null;
4545
}
4646
$result[$mediaParentTag][$moduleNameImage][Image::MEDIA_TYPE_CONFIG_NODE][$imageId][$attribute->tagName]
4747
= $nodeValue;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<xs:element name="aspect_ratio" type="xs:boolean" minOccurs="0" nillable="true"/>
5656
<xs:element name="frame" type="xs:boolean" minOccurs="0" nillable="true"/>
5757
<xs:element name="transparency" type="xs:boolean" minOccurs="0" nillable="true"/>
58-
<xs:element name="background" minOccurs="0">
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)