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

Fix document update for list of complex type elements

    XMLWordPrintable

    Details

    • Story Points:
      3

      Description

      Update for list of complex type elements with null as first value doesn't work with MarkLogic as a backend.

      Furthermore this leads to a corrupted data state in MarkLogic, the complex element is replaced by a list of primitive type.

      This issue was highlighted by TestSQLRepositoryProperties.testComplexListElementNullInStorage.

      Original document:

      {
        "tp:complexList:": [
          { "string": "for" },
          { "string": "bar" }
        ]
      }
      

      Expected document:

      {
        "tp:complexList:": [
          {},
          { "string": "bar" }
        ]
      }
      

      What we get:

      {
        "tp:complexList:": [
          "{string=bar}"
        ]
      }
      

      Error in test:

      testComplexListElementNullInStorage(org.nuxeo.ecm.core.TestSQLRepositoryProperties)  Time elapsed: 0.025 sec  <<< ERROR!
      java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List
      	at org.nuxeo.ecm.core.storage.dbs.DBSDocument.getChildAsList(DBSDocument.java:401)
      	at org.nuxeo.ecm.core.storage.dbs.DBSDocument.getChildAsList(DBSDocument.java:82)
      	at org.nuxeo.ecm.core.storage.BaseDocument.readComplexProperty(BaseDocument.java:672)
      	at org.nuxeo.ecm.core.storage.dbs.DBSDocument.readDocumentPart(DBSDocument.java:839)
      	at org.nuxeo.ecm.core.api.DocumentModelFactory.createDataModel(DocumentModelFactory.java:208)
      	at org.nuxeo.ecm.core.api.AbstractSession.getDataModel(AbstractSession.java:1894)
      	at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.loadDataModel(DocumentModelImpl.java:445)
      	at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getDataModel(DocumentModelImpl.java:455)
      	at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getPart(DocumentModelImpl.java:1219)
      	at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getProperty(DocumentModelImpl.java:1267)
      	at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.getPropertyValue(DocumentModelImpl.java:1326)
      	at org.nuxeo.ecm.core.TestSQLRepositoryProperties.testComplexListElementNullInStorage(TestSQLRepositoryProperties.java:416)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kleturc Kevin Leturc
                Reporter:
                kleturc Kevin Leturc
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: