-
Notifications
You must be signed in to change notification settings - Fork 578
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
Content-Definition with XSD: Wrong order for choice elements after XSD change or saving in control code editor #296
Comments
kaiwidmann
changed the title
Content-Definition with XSD: Wrong order for choice elements after xsd change or saving in source code editor
Content-Definition with XSD: Wrong order for choice elements after XSD change or saving in control code editor
Feb 11, 2015
kaiwidmann
added a commit
to mediaworx/opencms-core
that referenced
this issue
Feb 11, 2015
…or choice elements after XSD change or saving in control code editor)
This is ok in general but keep in mind to remove items from the choice list XML in case the choice definition is removed. A test case would be great. Existing test class for XML content schema modifications is: test/org.opencms.xml.content.TestCmsXmlContentSchemaModifications |
kaiwidmann
added a commit
to mediaworx/opencms-core
that referenced
this issue
Feb 11, 2015
…ed in the choice definition
aKandzior
added a commit
that referenced
this issue
Feb 27, 2015
Merged fix for issue #296 - Content-Definition with XSD: Wrong order for choice elements after XSD change or saving in control code editor (Improved)
Closed as the PR for this has been merged into the core. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When a content type definition uses a choice element that has maxOccurs > 1, then the "correctXmlStructure" functionality that is triggered by XSD changes or when the XML control code is edited and saved in OpenCms is causing a faulty ordering of child elements.
Simplified parent XSD:
Spimplified child XSD:
When the content type definition is changed and the content is edited again or when the XML control code of the content is edited and saved, the Method A-CmsXmlDocument.correctXmlStructure is triggered. And here's what happens:
Order of the form fields before correctXmlStructure:
Order of the form fields after correctXmlStructure:
So correctXmlStructure sorts the fields by type in the order of the choice definition. This is unexpected behaviour and it breaks the content every time the content type xsd is changed (or the control code is edited and saved).
The text was updated successfully, but these errors were encountered: