Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-24660

Fix constraint validation for complex fields with the same inner field

    XMLWordPrintable

    Details

    • Release Notes Summary:
      The constraints on complex fields with the same inner field are correctly validated.
    • Tags:
    • Backlog priority:
      800
    • Sprint:
      nxcore 10.2.7
    • Story Points:
      8

      Description

      The bug is visible when two fields are based on complex whose simple element has the same name, for instance value in the below XSD definiton

        <xs:element name="country" type="nxs:smt_country"/>
        <xs:complexType name="smt_country">
          <xs:sequence>
            <xs:element name="value">
              <xs:simpleType>
                <xs:restriction base="xs:string" ref:resolver="directoryResolver" ref:directory="country"/>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
        <xs:element name="language" type="nxs:smt_language"/>
        <xs:complexType name="smt_language">
          <xs:sequence>
            <xs:element name="value">
              <xs:simpleType>
                    <xs:restriction base="xs:string" ref:resolver="directoryResolver" ref:directory="language"/>
              </xs:simpleType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      

      After selecting a value for both fields and submitting the form, there will be a validation error

      "zh" is not a valid country id

      which is inconsistent because the second field use languages, not countries.

      The problem may be when the fields are registered after loading the XSD contributions

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 1 hour
                  2d 1h

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.