forked from ripenecommerce/magento2-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMagento_Widget-fix-support-for-multiple-parameter-dependencies.patch
56 lines (56 loc) · 2.15 KB
/
Magento_Widget-fix-support-for-multiple-parameter-dependencies.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
--- etc/widget.xsd.org 2017-03-09 23:15:28.210504683 +0100
+++ etc/widget.xsd 2017-03-09 23:15:32.122359252 +0100
@@ -209,8 +209,8 @@
<xs:annotation>
<xs:documentation>List of parameters this parameter depends on.</xs:documentation>
</xs:annotation>
- <xs:all>
+ <xs:choice maxOccurs="unbounded">
<xs:element name="parameter" type="dependsParameterType" />
- </xs:all>
+ </xs:choice>
</xs:complexType>
</xs:schema>
--- etc/widget_file.xsd.org 2017-03-09 23:15:52.457603263 +0100
+++ etc/widget_file.xsd 2017-03-09 23:15:56.977435232 +0100
@@ -209,8 +209,8 @@
<xs:annotation>
<xs:documentation>List of parameters this parameter depends on.</xs:documentation>
</xs:annotation>
- <xs:all>
+ <xs:choice maxOccurs="unbounded">
<xs:element name="parameter" type="dependsParameterType" />
- </xs:all>
+ </xs:choice>
</xs:complexType>
</xs:schema>
--- Model/Config/Converter.php.org 2017-03-09 23:28:51.660635367 +0100
+++ Model/Config/Converter.php 2017-03-09 23:34:34.083905332 +0100
@@ -231,11 +231,22 @@
);
}
$parameterAttributes = $childNode->attributes;
- $depends[$parameterAttributes->getNamedItem(
- 'name'
- )->nodeValue] = [
- 'value' => $parameterAttributes->getNamedItem('value')->nodeValue,
- ];
+
+ $dependencyName = $parameterAttributes->getNamedItem('name')->nodeValue;
+ $dependencyValue = $parameterAttributes->getNamedItem('value')->nodeValue;
+
+ if (!isset($depends[$dependencyName])) {
+ $depends[$dependencyName] = [
+ 'value' => $dependencyValue,
+ ];
+
+ continue;
+ } else if (!isset($depends[$dependencyName]['values'])) {
+ $depends[$dependencyName]['values'] = [$depends[$dependencyName]['value']];
+ unset($depends[$dependencyName]['value']);
+ }
+
+ $depends[$dependencyName]['values'][] = $dependencyValue;
}
return $depends;
}