Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #4470: import.xsd doesn't allow numbers in vendor name and class name #5420

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
],
'attributes_with_type_modelName_and_invalid_value' => [
'<?xml version="1.0"?><config><entity name="Name/one" model="model_one" '
. 'entityAttributeFilterType="model_one"/><entityType entity="Name/one" name="name_one" model="1"/>'
. ' <fileFormat name="name_one" model="model1"/></config>',
. 'entityAttributeFilterType="model_one"/><entityType entity="Name/one" name="name_one" model="-"/>'
. ' <fileFormat name="name_one" model="model-1"/></config>',
[
"Element 'entityType', attribute 'model': [facet 'pattern'] The value '1' is not accepted by the " .
"pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"Element 'entityType', attribute 'model': '1' is not a valid value of the atomic type" .
"Element 'entityType', attribute 'model': [facet 'pattern'] The value '-' is not accepted by the " .
"pattern '[A-Za-z_0-9\\\\\\\\]+'.\nLine: 1\n",
"Element 'entityType', attribute 'model': '-' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n",
"Element 'fileFormat', attribute 'model': [facet 'pattern'] The value 'model1' is not " .
"accepted by the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"Element 'fileFormat', attribute 'model': 'model1' is not a valid " .
"Element 'fileFormat', attribute 'model': [facet 'pattern'] The value 'model-1' is not " .
"accepted by the pattern '[A-Za-z_0-9\\\\\\\\]+'.\nLine: 1\n",
"Element 'fileFormat', attribute 'model': 'model-1' is not a valid " .
"value of the atomic type 'modelName'.\nLine: 1\n"
],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@
["Element 'entity', attribute 'notallowed': The attribute 'notallowed' is not allowed.\nLine: 1\n"],
],
'entity_model_with_invalid_value' => [
'<?xml version="1.0"?><config><entity name="test_name" label="test_label" model="afwer34" ' .
'<?xml version="1.0"?><config><entity name="test_name" label="test_label" model="afwer-blam" ' .
'behaviorModel="test" /></config>',
[
"Element 'entity', attribute 'model': [facet 'pattern'] The value 'afwer34' is not " .
"accepted by the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"Element 'entity', attribute 'model': 'afwer34' is not a valid value of the atomic type" .
"Element 'entity', attribute 'model': [facet 'pattern'] The value 'afwer-blam' is not " .
"accepted by the pattern '[A-Za-z_0-9\\\\\\\\]+'.\nLine: 1\n",
"Element 'entity', attribute 'model': 'afwer-blam' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
],
'entity_behaviorModel_with_invalid_value' => [
'<?xml version="1.0"?><config><entity name="test_name" label="test_label" model="test" behaviorModel="666" />' .
'</config>',
'<?xml version="1.0"?><config><entity name="test_name" label="test_label" model="test" ' .
'behaviorModel="6-66" /></config>',
[
"Element 'entity', attribute 'behaviorModel': [facet 'pattern'] The value '666' is not accepted by " .
"the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"Element 'entity', attribute 'behaviorModel': '666' is not a valid value of the atomic type" .
"Element 'entity', attribute 'behaviorModel': [facet 'pattern'] The value '6-66' is not accepted by " .
"the pattern '[A-Za-z_0-9\\\\\\\\]+'.\nLine: 1\n",
"Element 'entity', attribute 'behaviorModel': '6-66' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
["Element 'entity': The attribute 'name' is required but missing.\nLine: 1\n"],
],
'entity_with_invalid_model_value' => [
'<?xml version="1.0"?><config><entity name="some_name" model="12345"/></config>',
'<?xml version="1.0"?><config><entity name="some_name" model="123-45"/></config>',
[
"Element 'entity', attribute 'model': [facet 'pattern'] The value '12345' is not accepted by " .
"the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"Element 'entity', attribute 'model': '12345' is not a valid value of the atomic type" .
"Element 'entity', attribute 'model': [facet 'pattern'] The value '123-45' is not accepted by " .
"the pattern '[A-Za-z_0-9\\\\\\\\]+'.\nLine: 1\n",
"Element 'entity', attribute 'model': '123-45' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
],
'entity_with_invalid_behaviormodel_value' => [
'<?xml version="1.0"?><config><entity name="some_name" behaviorModel="=--09"/></config>',
[
"Element 'entity', attribute 'behaviorModel': [facet 'pattern'] The value '=--09' is not " .
"accepted by the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"accepted by the pattern '[A-Za-z_0-9\\\\\\\\]+'.\nLine: 1\n",
"Element 'entity', attribute 'behaviorModel': '=--09' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
Expand All @@ -46,11 +46,11 @@
["Element 'entityType': The attribute 'model' is required but missing.\nLine: 1\n"],
],
'entitytype_with_invalid_model_attribute_value' => [
'<?xml version="1.0"?><config><entityType entity="entity_name" name="some_name" model="test1"/></config>',
'<?xml version="1.0"?><config><entityType entity="entity_name" name="some_name" model="test-1"/></config>',
[
"Element 'entityType', attribute 'model': [facet 'pattern'] The value 'test1' is not " .
"accepted by the pattern '[A-Za-z_\\\\\\\\]+'.\nLine: 1\n",
"Element 'entityType', attribute 'model': 'test1' is not a valid value of the atomic type" .
"Element 'entityType', attribute 'model': [facet 'pattern'] The value 'test-1' is not " .
"accepted by the pattern '[A-Za-z_0-9\\\\\\\\]+'.\nLine: 1\n",
"Element 'entityType', attribute 'model': 'test-1' is not a valid value of the atomic type" .
" 'modelName'.\nLine: 1\n"
],
],
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/ImportExport/etc/export.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@
<xs:simpleType name="modelName">
<xs:annotation>
<xs:documentation>
Model name can contain only [A-Za-z_\\\\].
Model name can contain only [A-Za-z_0-9\\\\].
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z_\\\\]+" />
<xs:pattern value="[A-Za-z_0-9\\\\]+" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
4 changes: 2 additions & 2 deletions app/code/Magento/ImportExport/etc/import.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@
<xs:simpleType name="modelName">
<xs:annotation>
<xs:documentation>
Model name can contain only [A-Za-z_\\\\].
Model name can contain only [A-Za-z_0-9\\\\].
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Za-z_\\\\]+" />
<xs:pattern value="[A-Za-z_0-9\\\\]+" />
</xs:restriction>
</xs:simpleType>
</xs:schema>